diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index ce669f2757f7f3..12cbc988f4fb85 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c @@ -928,6 +928,9 @@ static int llc_ui_sendmsg(struct kiocb *iocb, struct socket *sock, if (size > llc->dev->mtu) size = llc->dev->mtu; copied = size - hdrlen; + rc = -EINVAL; + if (copied < 0) + goto release; release_sock(sk); skb = sock_alloc_send_skb(sk, size, noblock, &rc); lock_sock(sk);