diff options
author | Julia Lawall <julia@diku.dk> | 2011-02-02 12:13:36 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2011-03-11 09:22:44 -0500 |
commit | 3ee7451a023dd197fcfc1ba46dcce6d8ec5e1b78 (patch) | |
tree | b87527fb5eccede4c9236ecd1e521afa1ef02125 /drivers/mtd/maps | |
parent | f17f12ce9dd6ec0a8e1f415ecdbaebfce0207464 (diff) |
mtd: ts5500_flash: avoid calling map_destroy on NULL
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>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r-- | drivers/mtd/maps/ts5500_flash.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/mtd/maps/ts5500_flash.c b/drivers/mtd/maps/ts5500_flash.c index e2147bf11c88..e02dfa9d4ddd 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) | |||
94 | return 0; | 94 | return 0; |
95 | 95 | ||
96 | err1: | 96 | err1: |
97 | map_destroy(mymtd); | ||
98 | iounmap(ts5500_map.virt); | 97 | iounmap(ts5500_map.virt); |
99 | err2: | 98 | err2: |
100 | return rc; | 99 | return rc; |