summaryrefslogtreecommitdiff
path: root/drivers/mtd/ubi/vtbl.c
diff options
context:
space:
mode:
authorJulien Brunel <brunel@diku.dk>2008-09-26 17:27:25 +0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-09-26 20:24:37 +0400
commit0e4a008a4f389b468cfe8b58c7d77882a6e25695 (patch)
tree51a3cd9d3bc1cbcf7a09c8cfb7ac866e6215ce4f /drivers/mtd/ubi/vtbl.c
parent7d200e88cbdff5334d23d3af8d444eb9cc041962 (diff)
downloadlinux-0e4a008a4f389b468cfe8b58c7d77882a6e25695.tar.xz
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>
Diffstat (limited to 'drivers/mtd/ubi/vtbl.c')
0 files changed, 0 insertions, 0 deletions