* [PATCH 2/2] drivers/isdn/sc/ioctl.c: introduce missing kfree
@ 2008-06-08 12:58 Julia Lawall
0 siblings, 0 replies; only message in thread
From: Julia Lawall @ 2008-06-08 12:58 UTC (permalink / raw)
To: kkeil, isdn4linux, linux-kernel, kernel-janitors
From: Julia Lawall <julia@diku.dk>
spid has been allocated in this function and so should be freed before
leaving it, as in the other error handling cases.
The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
@r exists@
expression E,E1;
statement S;
position p1,p2,p3;
@@
E =@p1 \(kmalloc\|kcalloc\|kzalloc\)(...)
... when != E = E1
if (E == NULL || ...) S
... when != E = E1
if@p2 (...) {
... when != kfree(E)
}
... when != E = E1
kfree@p3(E);
@forall@
position r.p2;
expression r.E;
int E1 != 0;
@@
* if@p2 (...) {
... when != kfree(E)
when strict
return E1; }
Signed-off-by: Julia Lawall <julia@diku.dk>
---
diff -u -p a/drivers/isdn/sc/ioctl.c b/drivers/isdn/sc/ioctl.c
--- a/drivers/isdn/sc/ioctl.c
+++ b/drivers/isdn/sc/ioctl.c
@@ -226,6 +226,7 @@ int sc_ioctl(int card, scs_ioctl *data)
*/
if (copy_from_user(spid, data->dataptr, SCIOC_SPIDSIZE)) {
kfree(rcvmsg);
+ kfree(spid);
return -EFAULT;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-06-08 12:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-08 12:58 [PATCH 2/2] drivers/isdn/sc/ioctl.c: introduce missing kfree Julia Lawall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®