Skip to content

Commit

Permalink
rtnetlink: unlock on error path in netlink_dump()
Browse files Browse the repository at this point in the history
In c7ac867 "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: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Jun 17, 2011
1 parent 59deab2 commit c63d6ea
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/netlink/af_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,7 @@ static int netlink_dump(struct sock *sk)

skb = sock_rmalloc(sk, alloc_size, 0, GFP_KERNEL);
if (!skb)
goto errout;
goto errout_skb;

len = cb->dump(skb, cb);

Expand Down Expand Up @@ -1716,7 +1716,6 @@ static int netlink_dump(struct sock *sk)
errout_skb:
mutex_unlock(nlk->cb_mutex);
kfree_skb(skb);
errout:
return err;
}

Expand Down

0 comments on commit c63d6ea

Please sign in to comment.