Commit d3bc29a4 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'diag-raw-fixes'

Cyrill Gorcunov says:

net: Fixes for raw diag sockets handling

Hi! Here are a few fixes for raw-diag sockets handling: missing
sock_put call and jump for exiting from nested cycle. I made
patches for iproute2 as well so will send them out soon.

Signed-off-by: default avatarDavid S. Miller <>
parents 17197236 9999370f
......@@ -79,10 +79,11 @@ static struct sock *raw_sock_get(struct net *net, const struct inet_diag_req_v2
* hashinfo->lock here.
goto out_unlock;
return sk ? sk : ERR_PTR(-ENOENT);
......@@ -205,11 +206,14 @@ static int raw_diag_destroy(struct sk_buff *in_skb,
struct net *net = sock_net(in_skb->sk);
struct sock *sk;
int err;
sk = raw_sock_get(net, r);
if (IS_ERR(sk))
return PTR_ERR(sk);
return sock_diag_destroy(sk, ECONNABORTED);
err = sock_diag_destroy(sk, ECONNABORTED);
return err;
Supports Markdown
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