aboutsummaryrefslogtreecommitdiffstats
path: root/fs/romfs/super.c
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2009-09-23 18:57:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-24 10:21:05 -0400
commita21f3c2a04d8a8d26b4bf3523368380feb8742b7 (patch)
tree9cb49488e75959254e49fa03197f548b6ee1e33f /fs/romfs/super.c
parent9e5f1138d76e45b0ce56314ba0587e5942b55dcc (diff)
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>
Diffstat (limited to 'fs/romfs/super.c')
-rw-r--r--fs/romfs/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/romfs/super.c b/fs/romfs/super.c
index 47f132df0c3f..c117fa80d1e9 100644
--- a/fs/romfs/super.c
+++ b/fs/romfs/super.c
@@ -528,7 +528,7 @@ static int romfs_fill_super(struct super_block *sb, void *data, int silent)
528 pos = (ROMFH_SIZE + len + 1 + ROMFH_PAD) & ROMFH_MASK; 528 pos = (ROMFH_SIZE + len + 1 + ROMFH_PAD) & ROMFH_MASK;
529 529
530 root = romfs_iget(sb, pos); 530 root = romfs_iget(sb, pos);
531 if (!root) 531 if (IS_ERR(root))
532 goto error; 532 goto error;
533 533
534 sb->s_root = d_alloc_root(root); 534 sb->s_root = d_alloc_root(root);