提交 93f56089 编写于 作者: D Dave Jones 提交者: James Bottomley

[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: NDave Jones <davej@redhat.com>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 a0b6b6e5
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册