summaryrefslogtreecommitdiffstats
path: root/net/hsr
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2017-08-21 12:59:10 -0700
committerDavid S. Miller <davem@davemloft.net>2017-08-22 13:40:23 -0700
commit414e7d76af6d3ec2dd4e9079927dbe0e2e4ca914 (patch)
tree7c311865268205bccdd49a2739a88e847effcdde /net/hsr
parentc5cff8561d2d0006e972bd114afd51f082fee77c (diff)
downloadlinux-stable-414e7d76af6d3ec2dd4e9079927dbe0e2e4ca914.tar.gz
linux-stable-414e7d76af6d3ec2dd4e9079927dbe0e2e4ca914.tar.bz2
linux-stable-414e7d76af6d3ec2dd4e9079927dbe0e2e4ca914.zip
net/hsr: Check skb_put_padto() return value
skb_put_padto() will free the sk_buff passed as reference in case of errors, but we still need to check its return value and decide what to do. Detected by CoverityScan, CID#1416688 ("CHECKED_RETURN") Fixes: ee1c27977284 ("net/hsr: Added support for HSR v1") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/hsr')
-rw-r--r--net/hsr/hsr_device.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
index 4e7bdb213cd0..172d8309f89e 100644
--- a/net/hsr/hsr_device.c
+++ b/net/hsr/hsr_device.c
@@ -314,7 +314,8 @@ static void send_hsr_supervision_frame(struct hsr_port *master,
hsr_sp = skb_put(skb, sizeof(struct hsr_sup_payload));
ether_addr_copy(hsr_sp->MacAddressA, master->dev->dev_addr);
- skb_put_padto(skb, ETH_ZLEN + HSR_HLEN);
+ if (skb_put_padto(skb, ETH_ZLEN + HSR_HLEN))
+ return;
hsr_forward_skb(skb, master);
return;