summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-08-21 22:49:20 +0200
committerDavid S. Miller <davem@davemloft.net>2019-08-21 22:49:20 +0200
commit6e2866a9dfc63ca86290ad789961239de1b25a80 (patch)
treefdb753b4b90ab0b65f55d4d36529196251e1ff64 /net
parenttrivial: netns: fix typo in 'struct net.passive' description (diff)
parentbatman-adv: fix uninit-value in batadv_netlink_get_ifindex() (diff)
downloadlinux-6e2866a9dfc63ca86290ad789961239de1b25a80.tar.xz
linux-6e2866a9dfc63ca86290ad789961239de1b25a80.zip
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;
}
/**