[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20151123.233547.446739112661995737.davem@davemloft.net>
Date: Mon, 23 Nov 2015 23:35:47 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: ying.xue@...driver.com
Cc: jon.maloy@...csson.com, scan-admin@...erity.com,
stephen@...workplumber.org, netdev@...r.kernel.org,
tipc-discussion@...ts.sourceforge.net
Subject: Re: [PATCH] tipc: fix error handling of expanding buffer headroom
From: Ying Xue <ying.xue@...driver.com>
Date: Sun, 22 Nov 2015 15:38:39 +0800
> @@ -158,8 +158,11 @@ static int tipc_udp_send_msg(struct net *net, struct sk_buff *skb,
> struct udp_media_addr *src = (struct udp_media_addr *)&b->addr.value;
> 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;
> + }
pskb_expand_head() returns negative error codes, therefore zero means
success and therefore this "!err" check is reversed.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists