diff options
author | Yajun Deng <yajun.deng@linux.dev> | 2021-07-27 06:41:41 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-27 13:43:50 +0300 |
commit | f9b282b36dfa9b6c6d6b3e8816cdf0e4defff482 (patch) | |
tree | e632e0202b77a212cf2b6a2d4ef9982647699ebc /net/core/rtnetlink.c | |
parent | b0e81817629a496854ff1799f6cbd89597db65fd (diff) | |
download | linux-f9b282b36dfa9b6c6d6b3e8816cdf0e4defff482.tar.xz |
net: netlink: add the case when nlh is NULL
Add the case when nlh is NULL in nlmsg_report(),
so that the caller doesn't need to deal with this case.
Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r-- | net/core/rtnetlink.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 670d74ab91ae..e79aaf1f7139 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -726,12 +726,8 @@ void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group, struct nlmsghdr *nlh, gfp_t flags) { struct sock *rtnl = net->rtnl; - int report = 0; - if (nlh) - report = nlmsg_report(nlh); - - nlmsg_notify(rtnl, skb, pid, group, report, flags); + nlmsg_notify(rtnl, skb, pid, group, nlmsg_report(nlh), flags); } EXPORT_SYMBOL(rtnl_notify); |