Skip to content

Commit 778c4d5

Browse files
YueHaibingdavem330
authored andcommitted
fib_rules: NULL check before kfree is not needed
kfree(NULL) is safe,so this removes NULL check before freeing the mem Signed-off-by: YueHaibing <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 86ff736 commit 778c4d5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

net/core/fib_rules.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,8 +924,7 @@ int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr *nlh,
924924
return 0;
925925

926926
errout:
927-
if (nlrule)
928-
kfree(nlrule);
927+
kfree(nlrule);
929928
rules_ops_put(ops);
930929
return err;
931930
}

0 commit comments

Comments
 (0)