summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-08-21 13:49:20 -0700
committerDavid S. Miller <davem@davemloft.net>2019-08-21 13:49:20 -0700
commit6e2866a9dfc63ca86290ad789961239de1b25a80 (patch)
treefdb753b4b90ab0b65f55d4d36529196251e1ff64 /net
parentaad12c2394189f606ce0308ab65505fdd9081a10 (diff)
parent3ee1bb7aae97324ec9078da1f00cb2176919563f (diff)
downloadlinux-6e2866a9dfc63ca86290ad789961239de1b25a80.tar.bz2
Merge tag 'batadv-net-for-davem-20190821' of git://git.open-mesh.org/linux-merge
Simon Wunderlich says: ==================== Here is a batman-adv bugfix: - fix uninit-value in batadv_netlink_get_ifindex(), by Eric Dumazet ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/netlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
index 6f08fd122a8d..7e052d6f759b 100644
--- a/net/batman-adv/netlink.c
+++ b/net/batman-adv/netlink.c
@@ -164,7 +164,7 @@ batadv_netlink_get_ifindex(const struct nlmsghdr *nlh, int attrtype)
{
struct nlattr *attr = nlmsg_find_attr(nlh, GENL_HDRLEN, attrtype);
- return attr ? nla_get_u32(attr) : 0;
+ return (attr && nla_len(attr) == sizeof(u32)) ? nla_get_u32(attr) : 0;
}
/**