aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/net/netlink.h
diff options
context:
space:
mode:
authorYajun Deng <yajun.deng@linux.dev>2021-07-27 11:41:41 +0800
committerDavid S. Miller <davem@davemloft.net>2021-07-27 11:43:50 +0100
commitf9b282b36dfa9b6c6d6b3e8816cdf0e4defff482 (patch)
treee632e0202b77a212cf2b6a2d4ef9982647699ebc /include/net/netlink.h
parentnet: build all switchdev drivers as modules when the bridge is a module (diff)
downloadwireguard-linux-f9b282b36dfa9b6c6d6b3e8816cdf0e4defff482.tar.xz
wireguard-linux-f9b282b36dfa9b6c6d6b3e8816cdf0e4defff482.zip
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 'include/net/netlink.h')
-rw-r--r--include/net/netlink.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 1ceec518ab49..7a2a9d3144ba 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -885,7 +885,7 @@ static inline int nlmsg_validate_deprecated(const struct nlmsghdr *nlh,
*/
static inline int nlmsg_report(const struct nlmsghdr *nlh)
{
- return !!(nlh->nlmsg_flags & NLM_F_ECHO);
+ return nlh ? !!(nlh->nlmsg_flags & NLM_F_ECHO) : 0;
}
/**