diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index c2e629d6aea40e5519c3b865d62e1a092e6c9b60..4ae1b19ada5d3eb9e3c3c7f0b1b7a8030002eacb 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c @@ -854,7 +854,8 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, } done: dst_release(dst); - release_sock(sk); + if (!inet->hdrincl) + release_sock(sk); out: fl6_sock_release(flowlabel); return err<0?err:len;