2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-11-19 08:05:27 +08:00
linux-next/drivers/s390
Julia Lawall ba465d830e [S390] drivers/s390/block/dasd_ioctl.c: add missing kfree
Data is only used to temporarily hold information to be copied to the user
level, so it should be freed before leaving the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@exists@
local idexpression x;
statement S,S1;
expression E;
identifier fl;
expression *ptr != NULL;
@@

x = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
     when != if (...) { <+...kfree(x)...+> }
     when any
     when != true x == NULL
x->fl
...>
(
if (x == NULL) S1
|
if (...) { ... when != x
               when forall
(
 return \(0\|<+...x...+>\|ptr\);
|
* return ...;
)
}
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2011-08-24 17:15:23 +02:00
..
block [S390] drivers/s390/block/dasd_ioctl.c: add missing kfree 2011-08-24 17:15:23 +02:00
char [S390] sclp_async: Use kstrtoul_from_user 2011-08-03 16:44:20 +02:00
cio [S390] qdio: Use kstrtoul_from_user 2011-08-03 16:44:21 +02:00
crypto atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
kvm [S390] irq: merge irq.c and s390_ext.c 2011-05-26 09:48:24 +02:00
net atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
scsi atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
Makefile [S390] split/move machine check handler code 2009-03-26 15:24:10 +01:00