* [PATCH] drivers/mtd/maps/ts5500_flash.c: avoid calling map_destroy on NULL
@ 2011-02-02 16:53 Julia Lawall
2011-02-06 15:08 ` [PATCH] drivers/mtd/maps/ts5500_flash.c: avoid calling Artem Bityutskiy
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2011-02-02 16:53 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd, kernel-janitors, linux-kernel
map_destroy dereferences its argument. The call is furthermore only
reachable when this argument is NULL. Thus the call is dropped.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression *x;
@@
*if (x = NULL)
{ ...
* map_destroy(x);
...
return ...;
}
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/mtd/maps/ts5500_flash.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/mtd/maps/ts5500_flash.c b/drivers/mtd/maps/ts5500_flash.c
index e2147bf..e02dfa9 100644
--- a/drivers/mtd/maps/ts5500_flash.c
+++ b/drivers/mtd/maps/ts5500_flash.c
@@ -94,7 +94,6 @@ static int __init init_ts5500_map(void)
return 0;
err1:
- map_destroy(mymtd);
iounmap(ts5500_map.virt);
err2:
return rc;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers/mtd/maps/ts5500_flash.c: avoid calling
2011-02-02 16:53 [PATCH] drivers/mtd/maps/ts5500_flash.c: avoid calling map_destroy on NULL Julia Lawall
@ 2011-02-06 15:08 ` Artem Bityutskiy
0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2011-02-06 15:08 UTC (permalink / raw)
To: Julia Lawall; +Cc: linux-mtd, kernel-janitors, David Woodhouse, linux-kernel
On Wed, 2011-02-02 at 18:13 +0100, Julia Lawall wrote:
> map_destroy dereferences its argument. The call is furthermore only
> reachable when this argument is NULL. Thus the call is dropped.
>
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
Pushed to l2-mtd-2.6.git, thanks!
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-06 15:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-02 16:53 [PATCH] drivers/mtd/maps/ts5500_flash.c: avoid calling map_destroy on NULL Julia Lawall
2011-02-06 15:08 ` [PATCH] drivers/mtd/maps/ts5500_flash.c: avoid calling Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).