netrom: copy_datagram_iovec can fail
Subsystems (2)
PATCH 1/1 netrom: copy_datagram_iovec can fail
From: Alan Cox <[email protected]>
Check for an error from this and if so bail properly.
Signed-off-by Alan Cox <[email protected]>
---
net/netrom/af_netrom.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
net/netrom/af_netrom.c +6 -1
@@ -1169,7 +1169,12 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock, msg->msg_flags |=MSG_TRUNC ; } -skb_copy_datagram_iovec (skb,0 , msg->msg_iov, copied); + er =skb_copy_datagram_iovec (skb,0 , msg->msg_iov, copied); +if (er <0 ) { +skb_free_datagram (sk, skb); +release_sock (sk); +return er; + }if (sax !=NULL ) { sax->sax25_family =AF_NETROM ;
David Miller
maintainerFrom: Alan Cox <[email protected]>
Date: Tue, 04 Sep 2012 15:13:18 +0100
Quoted 5 lines
From: Alan Cox <[email protected]>
Check for an error from this and if so bail properly.
Signed-off-by Alan Cox <[email protected]>
Applied and queued up for -stable, thanks Alan.