Julia Lawall | 1 Aug 2010 19:23
Picon
Favicon

[PATCH] drivers/scsi/pm8001: introduce missing kfree

From: Julia Lawall <julia <at> diku.dk>

Error handling code following a kmalloc should free the allocated data.

The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
 <at> r exists <at> 
local idexpression x;
expression E;
identifier f,f1;
position p1,p2;
 <at>  <at> 

x <at> p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
<... when != x
     when != if (...) { <+...x...+> }
     when != (x) == NULL
     when != (x) != NULL
     when != (x) == 0
     when != (x) != 0
(
x->f1 = E
|
 (x->f1 == NULL || ...)
|
 f(...,x->f1,...)
)
...>
(Continue reading)

jack wang | 2 Aug 2010 03:34

RE: [PATCH] drivers/scsi/pm8001: introduce missing kfree


[Jack]Looks good to me! Thanks!
Acked-by: Jack Wang<jack_wang <at> usish.com>

From: Julia Lawall <julia <at> diku.dk>

Error handling code following a kmalloc should free the allocated data.

The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
 <at> r exists <at> 
local idexpression x;
expression E;
identifier f,f1;
position p1,p2;
 <at>  <at> 

x <at> p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
<... when != x
     when != if (...) { <+...x...+> }
     when != (x) == NULL
     when != (x) != NULL
     when != (x) == 0
     when != (x) != 0
(
x->f1 = E
|
 (x->f1 == NULL || ...)
(Continue reading)


Gmane