diff options
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r-- | drivers/scsi/sg.c | 9 |
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; |
478 | free_old_hdr: | 478 | free_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 | ||