diff options
author | Yajun Deng | 2021-08-05 19:55:27 +0800 |
---|---|---|
committer | David S. Miller | 2021-08-05 13:27:50 +0100 |
commit | 1160dfa178eb848327e9dec39960a735f4dc1685 (patch) | |
tree | b9e62879f43f63602da7a68c20d8e58a5acf79f3 /net/ethtool/netlink.c | |
parent | a85b99ab6abb583e051d266c2138647daa5c0ecc (diff) |
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/ethtool/netlink.c')
-rw-r--r-- | net/ethtool/netlink.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c index 417aaf9ca219..f8bca08e727e 100644 --- a/net/ethtool/netlink.c +++ b/net/ethtool/netlink.c @@ -398,8 +398,7 @@ static int ethnl_default_doit(struct sk_buff *skb, struct genl_info *info) ops->cleanup_data(reply_data); genlmsg_end(rskb, reply_payload); - if (req_info->dev) - dev_put(req_info->dev); + dev_put(req_info->dev); kfree(reply_data); kfree(req_info); return genlmsg_reply(rskb, info); @@ -411,8 +410,7 @@ err_cleanup: if (ops->cleanup_data) ops->cleanup_data(reply_data); err_dev: - if (req_info->dev) - dev_put(req_info->dev); + dev_put(req_info->dev); kfree(reply_data); kfree(req_info); return ret; |