Skip to content

Commit

Permalink
jffs2: Avoid unneeded 'if' before kfree
Browse files Browse the repository at this point in the history
kfree() deals gracefully with NULL pointers, so it's pointless to test for
one prior to calling it.
This removes such a test from jffs2_scan_medium().

Signed-off-by: Jesper Juhl <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
  • Loading branch information
jjuhl authored and dedekind committed Sep 11, 2011
1 parent e638275 commit e8a0e41
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/jffs2/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
else
c->mtd->unpoint(c->mtd, 0, c->mtd->size);
#endif
if (s)
kfree(s);

kfree(s);
return ret;
}

Expand Down

0 comments on commit e8a0e41

Please sign in to comment.