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_proc.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_proc.c')
-rw-r--r-- | drivers/scsi/gdth_proc.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c index 0572b9bf4bd6..652754319a4b 100644 --- a/drivers/scsi/gdth_proc.c +++ b/drivers/scsi/gdth_proc.c | |||
@@ -365,8 +365,10 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length, | |||
365 | len = 0; | 365 | len = 0; |
366 | begin = pos; | 366 | begin = pos; |
367 | } | 367 | } |
368 | if (pos > offset + length) | 368 | if (pos > offset + length) { |
369 | gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); | ||
369 | goto stop_output; | 370 | goto stop_output; |
371 | } | ||
370 | } | 372 | } |
371 | } | 373 | } |
372 | gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); | 374 | gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); |
@@ -450,8 +452,10 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length, | |||
450 | len = 0; | 452 | len = 0; |
451 | begin = pos; | 453 | begin = pos; |
452 | } | 454 | } |
453 | if (pos > offset + length) | 455 | if (pos > offset + length) { |
456 | gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); | ||
454 | goto stop_output; | 457 | goto stop_output; |
458 | } | ||
455 | } while (drv_no != -1); | 459 | } while (drv_no != -1); |
456 | 460 | ||
457 | if (is_mirr) { | 461 | if (is_mirr) { |
@@ -472,8 +476,10 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length, | |||
472 | len = 0; | 476 | len = 0; |
473 | begin = pos; | 477 | begin = pos; |
474 | } | 478 | } |
475 | if (pos > offset + length) | 479 | if (pos > offset + length) { |
480 | gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); | ||
476 | goto stop_output; | 481 | goto stop_output; |
482 | } | ||
477 | } | 483 | } |
478 | gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); | 484 | gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); |
479 | 485 | ||
@@ -542,8 +548,10 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length, | |||
542 | len = 0; | 548 | len = 0; |
543 | begin = pos; | 549 | begin = pos; |
544 | } | 550 | } |
545 | if (pos > offset + length) | 551 | if (pos > offset + length) { |
552 | gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); | ||
546 | goto stop_output; | 553 | goto stop_output; |
554 | } | ||
547 | } | 555 | } |
548 | } | 556 | } |
549 | gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); | 557 | gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); |