summaryrefslogtreecommitdiffstats
path: root/net/netlabel
diff options
context:
space:
mode:
authorYajun Deng <yajun.deng@linux.dev>2021-08-05 19:55:27 +0800
committerDavid S. Miller <davem@davemloft.net>2021-08-05 13:27:50 +0100
commit1160dfa178eb848327e9dec39960a735f4dc1685 (patch)
treeb9e62879f43f63602da7a68c20d8e58a5acf79f3 /net/netlabel
parenta85b99ab6abb583e051d266c2138647daa5c0ecc (diff)
downloadlinux-1160dfa178eb848327e9dec39960a735f4dc1685.tar.gz
linux-1160dfa178eb848327e9dec39960a735f4dc1685.tar.bz2
linux-1160dfa178eb848327e9dec39960a735f4dc1685.zip
net: Remove redundant if statements
The 'if (dev)' statement already move into dev_{put , hold}, so remove redundant if statements. Signed-off-by: Yajun Deng <yajun.deng@linux.dev> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlabel')
-rw-r--r--net/netlabel/netlabel_unlabeled.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
index 2483df0bbd7c..566ba4397ee4 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -492,8 +492,7 @@ static int netlbl_unlhsh_remove_addr4(struct net *net,
netlbl_af4list_audit_addr(audit_buf, 1,
(dev != NULL ? dev->name : NULL),
addr->s_addr, mask->s_addr);
- if (dev != NULL)
- dev_put(dev);
+ dev_put(dev);
if (entry != NULL &&
security_secid_to_secctx(entry->secid,
&secctx, &secctx_len) == 0) {
@@ -553,8 +552,7 @@ static int netlbl_unlhsh_remove_addr6(struct net *net,
netlbl_af6list_audit_addr(audit_buf, 1,
(dev != NULL ? dev->name : NULL),
addr, mask);
- if (dev != NULL)
- dev_put(dev);
+ dev_put(dev);
if (entry != NULL &&
security_secid_to_secctx(entry->secid,
&secctx, &secctx_len) == 0) {