diff --git a/net/tipc/socket.c b/net/tipc/socket.c index ede78b144dcf..8c5600cfcc3e 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -784,8 +784,9 @@ static int tipc_sendmsg(struct kiocb *iocb, struct socket *sock, break; rc = tipc_wait_for_sndmsg(sock, &timeo); + if (rc) + kfree_skb_list(buf); } while (!rc); - exit: if (iocb) release_sock(sk); @@ -898,6 +899,8 @@ static int tipc_send_stream(struct kiocb *iocb, struct socket *sock, break; } rc = tipc_wait_for_sndpkt(sock, &timeo); + if (rc) + kfree_skb_list(buf); } while (!rc); exit: if (iocb)