diff options
author | Yajun Deng <yajun.deng@linux.dev> | 2021-07-27 11:41:41 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-27 11:43:50 +0100 |
commit | f9b282b36dfa9b6c6d6b3e8816cdf0e4defff482 (patch) | |
tree | e632e0202b77a212cf2b6a2d4ef9982647699ebc /include/net/netlink.h | |
parent | b0e81817629a496854ff1799f6cbd89597db65fd (diff) |
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.h | 2 |
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; } /** |