* [PATCH] netrom: copy_datagram_iovec can fail
@ 2012-09-04 14:13 Alan Cox
2012-09-04 16:58 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Alan Cox @ 2012-09-04 14:13 UTC (permalink / raw)
To: netdev
From: Alan Cox <alan@linux.intel.com>
Check for an error from this and if so bail properly.
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
net/netrom/af_netrom.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 06592d8..1b9024e 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] netrom: copy_datagram_iovec can fail
2012-09-04 14:13 [PATCH] netrom: copy_datagram_iovec can fail Alan Cox
@ 2012-09-04 16:58 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-09-04 16:58 UTC (permalink / raw)
To: alan; +Cc: netdev
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
Date: Tue, 04 Sep 2012 15:13:18 +0100
> From: Alan Cox <alan@linux.intel.com>
>
> Check for an error from this and if so bail properly.
>
> Signed-off-by: Alan Cox <alan@linux.intel.com>
Applied and queued up for -stable, thanks Alan.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-04 16:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-04 14:13 [PATCH] netrom: copy_datagram_iovec can fail Alan Cox
2012-09-04 16:58 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).