Skip to content

Commit

Permalink
configfs: move the dereference below the NULL test
Browse files Browse the repository at this point in the history
The dereference should be moved below the NULL test.

spatch with a semantic match is used to found this.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <[email protected]>
Cc: Joel Becker <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Wei Yongjun authored and torvalds committed Feb 22, 2013
1 parent 1b2643f commit 49deb4b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/configfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,10 +1037,11 @@ static int configfs_dump(struct configfs_dirent *sd, int level)
static int configfs_depend_prep(struct dentry *origin,
struct config_item *target)
{
struct configfs_dirent *child_sd, *sd = origin->d_fsdata;
struct configfs_dirent *child_sd, *sd;
int ret = 0;

BUG_ON(!origin || !sd);
BUG_ON(!origin || !origin->d_fsdata);
sd = origin->d_fsdata;

if (sd->s_element == target) /* Boo-yah */
goto out;
Expand Down

0 comments on commit 49deb4b

Please sign in to comment.