aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2006-03-09 10:21:27 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-03-12 10:25:40 -0500
commit93f56089898a1b27fc0c89b5c1c748291353f679 (patch)
tree4c1280939653d737d3e79d65fd58c3301ec6d8bf /drivers/scsi
parenta0b6b6e5308d6ef70febfc3cfd5488717809b3e4 (diff)
[SCSI] fix two leaks in scsi_alloc_sdev failure paths
If the scsi_alloc_queue or the slave_alloc calls in scsi_alloc_device fail, we forget to release the locally allocated sdev on the failure path. Coverity #609 Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/scsi_scan.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index be14f9d82fde..5d4ca87af3df 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -251,6 +251,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
251 /* release fn is set up in scsi_sysfs_device_initialise, so 251 /* release fn is set up in scsi_sysfs_device_initialise, so
252 * have to free and put manually here */ 252 * have to free and put manually here */
253 put_device(&starget->dev); 253 put_device(&starget->dev);
254 kfree(sdev);
254 goto out; 255 goto out;
255 } 256 }
256 257