Commit 6cf5c951 authored by Alan Cox's avatar Alan Cox Committed by David S. Miller

netrom: copy_datagram_iovec can fail

Check for an error from this and if so bail properly.
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9fef7685
...@@ -1169,7 +1169,12 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -1169,7 +1169,12 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock,
msg->msg_flags |= MSG_TRUNC; 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) { if (sax != NULL) {
sax->sax25_family = AF_NETROM; sax->sax25_family = AF_NETROM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment