From 5c10007560589a2335a77cbc92347b1474518296 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Wed, 29 Dec 2010 15:57:54 +0100 Subject: [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/) // @@ 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 ...; // Signed-off-by: Julia Lawall Signed-off-by: James Bottomley --- drivers/scsi/gdth_proc.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'drivers/scsi/gdth_proc.c') 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, len = 0; begin = pos; } - if (pos > offset + length) + if (pos > offset + length) { + gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); goto stop_output; + } } } 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, len = 0; begin = pos; } - if (pos > offset + length) + if (pos > offset + length) { + gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); goto stop_output; + } } while (drv_no != -1); if (is_mirr) { @@ -472,8 +476,10 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length, len = 0; begin = pos; } - if (pos > offset + length) + if (pos > offset + length) { + gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); goto stop_output; + } } gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); @@ -542,8 +548,10 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length, len = 0; begin = pos; } - if (pos > offset + length) + if (pos > offset + length) { + gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); goto stop_output; + } } } gdth_ioctl_free(ha, GDTH_SCRATCH, buf, paddr); -- cgit