[PATCH 4.3 36/71] tipc: fix error handling of expanding buffer headroom

From: Greg Kroah-Hartman
Date: Sat Dec 12 2015 - 15:26:56 EST


4.3-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ying Xue <ying.xue@xxxxxxxxxxxxx>

[ Upstream commit 7098356baca723513e97ca0020df4e18bc353be3 ]

Coverity says:

---
net/tipc/udp_media.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

--- a/net/tipc/udp_media.c
+++ b/net/tipc/udp_media.c
@@ -159,8 +159,11 @@ static int tipc_udp_send_msg(struct net
struct sk_buff *clone;
struct rtable *rt;

- if (skb_headroom(skb) < UDP_MIN_HEADROOM)
- pskb_expand_head(skb, UDP_MIN_HEADROOM, 0, GFP_ATOMIC);
+ if (skb_headroom(skb) < UDP_MIN_HEADROOM) {
+ err = pskb_expand_head(skb, UDP_MIN_HEADROOM, 0, GFP_ATOMIC);
+ if (err)
+ goto tx_error;
+ }

clone = skb_clone(skb, GFP_ATOMIC);
skb_set_inner_protocol(clone, htons(ETH_P_TIPC));


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/