Commit c63d6ea3 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller
Browse files

rtnetlink: unlock on error path in netlink_dump()

In c7ac8679

 "rtnetlink: Compute and store minimum ifinfo dump
size", we moved the allocation under the lock so we need to unlock
on error path.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@conan.davemloft.net>
parent 59deab26
...@@ -1676,7 +1676,7 @@ static int netlink_dump(struct sock *sk) ...@@ -1676,7 +1676,7 @@ static int netlink_dump(struct sock *sk)
skb = sock_rmalloc(sk, alloc_size, 0, GFP_KERNEL); skb = sock_rmalloc(sk, alloc_size, 0, GFP_KERNEL);
if (!skb) if (!skb)
goto errout; goto errout_skb;
len = cb->dump(skb, cb); len = cb->dump(skb, cb);
...@@ -1716,7 +1716,6 @@ static int netlink_dump(struct sock *sk) ...@@ -1716,7 +1716,6 @@ static int netlink_dump(struct sock *sk)
errout_skb: errout_skb:
mutex_unlock(nlk->cb_mutex); mutex_unlock(nlk->cb_mutex);
kfree_skb(skb); kfree_skb(skb);
errout:
return err; return err;
} }
......
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