diff options
author | Roland Dreier <rolandd@cisco.com> | 2011-03-14 07:05:55 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-03-23 12:36:18 -0400 |
commit | 8fc1858a42663248d5b362edc313786e0be7a639 (patch) | |
tree | 6155d3bed0467864b7841830479a1122422e1c2f /drivers/target | |
parent | 4b3203052494ea7b0a445ace676cd2013917c807 (diff) |
[SCSI] target: Fix memory leak on error path in pscsi_alloc_task
If allocation of pt->pscsi_cdb fails, we need to free the just-allocated
pt or else it will be leaked.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_pscsi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 5a9d2ba4b609..3031ef8261ef 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c | |||
@@ -816,6 +816,7 @@ pscsi_alloc_task(struct se_cmd *cmd) | |||
816 | if (!(pt->pscsi_cdb)) { | 816 | if (!(pt->pscsi_cdb)) { |
817 | printk(KERN_ERR "pSCSI: Unable to allocate extended" | 817 | printk(KERN_ERR "pSCSI: Unable to allocate extended" |
818 | " pt->pscsi_cdb\n"); | 818 | " pt->pscsi_cdb\n"); |
819 | kfree(pt); | ||
819 | return NULL; | 820 | return NULL; |
820 | } | 821 | } |
821 | } else | 822 | } else |