]> git.baikalelectronics.ru Git - kernel.git/commit
fs/romfs: correct error-handling code
authorJulia Lawall <julia@diku.dk>
Wed, 23 Sep 2009 22:57:35 +0000 (15:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Sep 2009 14:21:05 +0000 (07:21 -0700)
commitf04a31fc32fc71a02d8665dbc4546acd007fab5f
tree9cb49488e75959254e49fa03197f548b6ee1e33f
parent46cad699501c5d81b08696040303b4c508a2a478
fs/romfs: correct error-handling code

romfs_iget returns an ERR_PTR value in an error case instead of NULL.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@match exists@
expression x, E;
statement S1, S2;
@@

x = romfs_iget(...)
... when != x = E
(
*  if (x == NULL || ...) S1 else S2
|
*  if (x == NULL && ...) S1 else S2
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/romfs/super.c