aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sg.c
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2005-11-07 04:01:26 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 10:54:01 -0500
commitc9475cb0c358ff0dd473544280d92482df491913 (patch)
tree091617d0bdab9273d44139c86af21b7540e6d9b1 /drivers/scsi/sg.c
parent089b1dbbde28f0f641c20beabba28fa89ab4fab9 (diff)
[PATCH] kfree cleanup: drivers/scsi
This is the drivers/scsi/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in drivers/scsi/. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Cc: James Bottomley <James.Bottomley@steeleye.com> Acked-by: Kai Makisara <kai.makisara@kolumbus.fi> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r--drivers/scsi/sg.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 4f30a37db63c..62e3f340cc52 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -476,8 +476,7 @@ sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
476 sg_finish_rem_req(srp); 476 sg_finish_rem_req(srp);
477 retval = count; 477 retval = count;
478free_old_hdr: 478free_old_hdr:
479 if (old_hdr) 479 kfree(old_hdr);
480 kfree(old_hdr);
481 return retval; 480 return retval;
482} 481}
483 482
@@ -1703,10 +1702,8 @@ exit_sg(void)
1703 sg_sysfs_valid = 0; 1702 sg_sysfs_valid = 0;
1704 unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), 1703 unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0),
1705 SG_MAX_DEVS); 1704 SG_MAX_DEVS);
1706 if (sg_dev_arr != NULL) { 1705 kfree((char *)sg_dev_arr);
1707 kfree((char *) sg_dev_arr); 1706 sg_dev_arr = NULL;
1708 sg_dev_arr = NULL;
1709 }
1710 sg_dev_max = 0; 1707 sg_dev_max = 0;
1711} 1708}
1712 1709