diff options
author | Quentin Lambert <lambert.quentin@gmail.com> | 2016-11-19 18:42:34 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-11-29 17:54:40 +0100 |
commit | 021e2927586dafc0a682b7f95d75bd06cc4fb703 (patch) | |
tree | 0c9852f4a54969b4aa51ec93b441cae3000023ef /drivers/scsi/dpt_i2o.c | |
parent | scsi: isci: Add a missing call to pci_unmap_biosrom (diff) | |
download | linux-021e2927586dafc0a682b7f95d75bd06cc4fb703.tar.xz linux-021e2927586dafc0a682b7f95d75bd06cc4fb703.zip |
scsi: dpt_i2o: Add a missing call to kfree
Most error branches following the call to kzalloc contain a call to
kfree. This patch add these calls where they are missing.
This issue was found with Hector.
Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/dpt_i2o.c')
-rw-r--r-- | drivers/scsi/dpt_i2o.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index d84004b5d3e0..f88b3d216a88 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c @@ -1754,8 +1754,10 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg) sg_offset = (msg[0]>>4)&0xf; msg[2] = 0x40000000; // IOCTL context msg[3] = adpt_ioctl_to_context(pHba, reply); - if (msg[3] == (u32)-1) + if (msg[3] == (u32)-1) { + kfree(reply); return -EBUSY; + } memset(sg_list,0, sizeof(sg_list[0])*pHba->sg_tablesize); if(sg_offset) { |