net/hsr: Check skb_put_padto() return value
Subsystems (3)
PATCH 1/1 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 <[email protected]>
--- net/hsr/hsr_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/hsr/hsr_device.c +2 -1
@@ -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 ;
Signature · 1 line
2.9.3
From: Florian Fainelli <[email protected]>
Date: Mon, 21 Aug 2017 12:59:10 -0700
Quoted 8 lines
skb_put_padto()will free thesk_buffpassed 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 <[email protected]>
Applied, thanks.