From: Hangbin Liu Date: Sat, 6 May 2017 03:17:06 +0000 (+0800) Subject: bonding: check nla_put_be32 return value X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d62844a825e87da345e11639e98deb617ef11e08;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git bonding: check nla_put_be32 return value Signed-off-by: Hangbin Liu Signed-off-by: David S. Miller --- diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c index c502c139d3bc..47a8103610bc 100644 --- a/drivers/net/bonding/bond_netlink.c +++ b/drivers/net/bonding/bond_netlink.c @@ -549,7 +549,8 @@ static int bond_fill_info(struct sk_buff *skb, targets_added = 0; for (i = 0; i < BOND_MAX_ARP_TARGETS; i++) { if (bond->params.arp_targets[i]) { - nla_put_be32(skb, i, bond->params.arp_targets[i]); + if (nla_put_be32(skb, i, bond->params.arp_targets[i])) + goto nla_put_failure; targets_added = 1; } }