From: Dave Jones Date: Thu, 9 Mar 2006 15:21:27 +0000 (-0500) Subject: [SCSI] fix two leaks in scsi_alloc_sdev failure paths X-Git-Tag: v2.6.17-rc1~732^2~22^2~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=93f56089898a1b27fc0c89b5c1c748291353f679;p=profile%2Fivi%2Fkernel-x86-ivi.git [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 Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index be14f9d..5d4ca87 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, /* release fn is set up in scsi_sysfs_device_initialise, so * have to free and put manually here */ put_device(&starget->dev); + kfree(sdev); goto out; }