* [PATCH 1/2] drivers/s390/char/tape_3590.c: introduce missing kfree
@ 2008-06-08 12:56 ` Julia Lawall
0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2008-06-08 12:56 UTC (permalink / raw)
To: schwidefsky, heiko.carstens, linux-s390, linux-kernel,
kernel-janitors
From: Julia Lawall <julia@diku.dk>
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/s390/char/tape_3590.c b/drivers/s390/char/tape_3590.c
--- a/drivers/s390/char/tape_3590.c
+++ b/drivers/s390/char/tape_3590.c
@@ -1598,7 +1598,7 @@ tape_3590_setup_device(struct tape_devic
rc = tape_3590_read_dev_chars(device, rdc_data);
if (rc) {
DBF_LH(3, "Read device characteristics failed!\n");
- goto fail_kmalloc;
+ goto fail_rdc_data;
}
rc = tape_std_assign(device);
if (rc)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] drivers/s390/char/tape_3590.c: introduce missing kfree
@ 2008-06-08 12:56 ` Julia Lawall
0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2008-06-08 12:56 UTC (permalink / raw)
To: schwidefsky, heiko.carstens, linux-s390, linux-kernel,
kernel-janitors
From: Julia Lawall <julia@diku.dk>
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/s390/char/tape_3590.c b/drivers/s390/char/tape_3590.c
--- a/drivers/s390/char/tape_3590.c
+++ b/drivers/s390/char/tape_3590.c
@@ -1598,7 +1598,7 @@ tape_3590_setup_device(struct tape_devic
rc = tape_3590_read_dev_chars(device, rdc_data);
if (rc) {
DBF_LH(3, "Read device characteristics failed!\n");
- goto fail_kmalloc;
+ goto fail_rdc_data;
}
rc = tape_std_assign(device);
if (rc)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] drivers/s390/char/tape_3590.c: introduce missing
2008-06-08 12:56 ` Julia Lawall
@ 2008-06-09 8:35 ` Martin Schwidefsky
-1 siblings, 0 replies; 4+ messages in thread
From: Martin Schwidefsky @ 2008-06-09 8:35 UTC (permalink / raw)
To: Julia Lawall; +Cc: heiko.carstens, linux-s390, linux-kernel, kernel-janitors
On Sun, 2008-06-08 at 14:56 +0200, Julia Lawall wrote:
> diff -u -p a/drivers/s390/char/tape_3590.c
> b/drivers/s390/char/tape_3590.c
> --- a/drivers/s390/char/tape_3590.c
> +++ b/drivers/s390/char/tape_3590.c
> @@ -1598,7 +1598,7 @@ tape_3590_setup_device(struct tape_devic
> rc = tape_3590_read_dev_chars(device, rdc_data);
> if (rc) {
> DBF_LH(3, "Read device characteristics failed!\n");
> - goto fail_kmalloc;
> + goto fail_rdc_data;
> }
> rc = tape_std_assign(device);
> if (rc)
>
Nice catch! I'll add this to the git390 queue for 2.6.26.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] drivers/s390/char/tape_3590.c: introduce missing kfree
@ 2008-06-09 8:35 ` Martin Schwidefsky
0 siblings, 0 replies; 4+ messages in thread
From: Martin Schwidefsky @ 2008-06-09 8:35 UTC (permalink / raw)
To: Julia Lawall; +Cc: heiko.carstens, linux-s390, linux-kernel, kernel-janitors
On Sun, 2008-06-08 at 14:56 +0200, Julia Lawall wrote:
> diff -u -p a/drivers/s390/char/tape_3590.c
> b/drivers/s390/char/tape_3590.c
> --- a/drivers/s390/char/tape_3590.c
> +++ b/drivers/s390/char/tape_3590.c
> @@ -1598,7 +1598,7 @@ tape_3590_setup_device(struct tape_devic
> rc = tape_3590_read_dev_chars(device, rdc_data);
> if (rc) {
> DBF_LH(3, "Read device characteristics failed!\n");
> - goto fail_kmalloc;
> + goto fail_rdc_data;
> }
> rc = tape_std_assign(device);
> if (rc)
>
Nice catch! I'll add this to the git390 queue for 2.6.26.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-06-09 8:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-08 12:56 [PATCH 1/2] drivers/s390/char/tape_3590.c: introduce missing kfree Julia Lawall
2008-06-08 12:56 ` Julia Lawall
2008-06-09 8:35 ` [PATCH 1/2] drivers/s390/char/tape_3590.c: introduce missing Martin Schwidefsky
2008-06-09 8:35 ` [PATCH 1/2] drivers/s390/char/tape_3590.c: introduce missing kfree Martin Schwidefsky
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.