]> git.baikalelectronics.ru Git - kernel.git/commit
net/af_iucv: fix skb handling on HiperTransport xmit error
authorJulian Wiedmann <jwi@linux.ibm.com>
Wed, 5 Sep 2018 14:55:11 +0000 (16:55 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Sep 2018 05:32:22 +0000 (22:32 -0700)
commite0b005441aafcd2ecf84f1a649815f0ba8d0f252
treed74f5146a3c826668397c59eca92b492a34e13c9
parent8fec99511e0d339d004ee199906708addbe29ab0
net/af_iucv: fix skb handling on HiperTransport xmit error

When sending an skb, afiucv_hs_send() bails out on various error
conditions. But currently the caller has no way of telling whether the
skb was freed or not - resulting in potentially either
a) leaked skbs from iucv_send_ctrl(), or
b) double-free's from iucv_sock_sendmsg().

As dev_queue_xmit() will always consume the skb (even on error), be
consistent and also free the skb from all other error paths. This way
callers no longer need to care about managing the skb.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/iucv/af_iucv.c