linux/drivers/mtd
Julien Brunel 0e4a008a4f UBI: fix IS_ERR test
In case of error, the function add_volume returns an ERR pointer. The
result of IS_ERR, which is supposed to be used in a test as it is, is
here checked to be less than zero, which seems odd. We suggest to
replace this test by a simple IS_ERR test.

A simplified version of the semantic match that finds this problem is
as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@def0@
expression x;
position p0;
@@
x@p0 = add_volume(...)

@protected@
expression def0.x,E;
position def0.p0;
position p;
statement S;
@@
x@p0
... when != x = E
if (!IS_ERR(x) && ...) {<... x@p ...>} else S

@unprotected@
expression def0.x,E;
identifier fld;
position def0.p0;
position p != protected.p;
@@
x@p0
... when != x = E
* x@p->fld
// </smpl>

Signed-off-by:  Julien Brunel <brunel@diku.dk>
Signed-off-by:  Julia Lawall <julia@diku.dk>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-09-26 19:24:37 +03:00
..
chips [MTD] [NOR] drivers/mtd/chips/jedec_probe.c: fix Am29DL800BB device ID 2008-07-31 08:34:46 +01:00
devices [MTD] DataFlash: bugfix, binary page sizes now handled 2008-07-30 14:20:32 +01:00
maps removed unused #include <linux/version.h>'s 2008-08-23 12:14:12 -07:00
nand removed unused #include <linux/version.h>'s 2008-08-23 12:14:12 -07:00
onenand
ubi UBI: fix IS_ERR test 2008-09-26 19:24:37 +03:00
afs.c
ar7part.c
cmdlinepart.c
ftl.c Merge branch 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6 2008-07-25 10:40:14 -04:00
inftlcore.c
inftlmount.c
Kconfig
Makefile
mtd_blkdevs.c
mtdblock_ro.c
mtdblock.c
mtdchar.c Merge branch 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6 2008-07-25 10:40:14 -04:00
mtdconcat.c
mtdcore.c
mtdcore.h
mtdoops.c
mtdpart.c [MTD][MTDPART] Fix a division by zero bug 2008-07-25 10:00:11 -04:00
mtdsuper.c [MTD] Fix !CONFIG_BLOCK compile for mtdsuper.c 2008-08-02 07:52:39 +01:00
nftlcore.c
nftlmount.c
ofpart.c
redboot.c
rfd_ftl.c
ssfdc.c