diff options
author | Julia Lawall <julia@diku.dk> | 2010-12-29 09:57:54 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-12-31 10:50:09 -0500 |
commit | 5c10007560589a2335a77cbc92347b1474518296 (patch) | |
tree | 662d3e17401bd678a89b82cf635b2719de245917 /drivers/scsi/gdth.c | |
parent | 8f4bfadd200477acb6dcf41a45919dd37d01a6db (diff) |
[SCSI] gdth: Add missing call to gdth_ioctl_free
Add missing call to gdth_ioctl_free before aborting.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression buf,ha,len,addr,E;
@@
buf = gdth_ioctl_alloc(ha, len, FALSE, &addr)
... when != false buf != NULL
when != true buf == NULL
when != \(E = buf\|buf = E\)
when != gdth_ioctl_free(ha, len, buf, addr)
*return ...;
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/gdth.c')
-rw-r--r-- | drivers/scsi/gdth.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index 76365700e2d5..3242bcabad97 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c | |||
@@ -4273,8 +4273,10 @@ static int ioc_general(void __user *arg, char *cmnd) | |||
4273 | } | 4273 | } |
4274 | 4274 | ||
4275 | rval = __gdth_execute(ha->sdev, &gen.command, cmnd, gen.timeout, &gen.info); | 4275 | rval = __gdth_execute(ha->sdev, &gen.command, cmnd, gen.timeout, &gen.info); |
4276 | if (rval < 0) | 4276 | if (rval < 0) { |
4277 | gdth_ioctl_free(ha, gen.data_len+gen.sense_len, buf, paddr); | ||
4277 | return rval; | 4278 | return rval; |
4279 | } | ||
4278 | gen.status = rval; | 4280 | gen.status = rval; |
4279 | 4281 | ||
4280 | if (copy_to_user(arg + sizeof(gdth_ioctl_general), buf, | 4282 | if (copy_to_user(arg + sizeof(gdth_ioctl_general), buf, |