In case memory resources for buf were allocated, release them before
return.
Addresses-Coverity-ID:
1492011 ("Resource leak")
Fixes: a7a29f9c361f ("net: ipv6: add rpl sr tunnel")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
hdrlen = ((csrh->hdrlen + 1) << 3);
err = skb_cow_head(skb, hdrlen + skb->mac_len);
- if (unlikely(err))
+ if (unlikely(err)) {
+ kfree(buf);
return err;
+ }
skb_pull(skb, sizeof(struct ipv6hdr));
skb_postpull_rcsum(skb, skb_network_header(skb),