Skip to content

Commit

Permalink
dcb: unlock on error in dcbnl_ieee_get()
Browse files Browse the repository at this point in the history
There is a "goto nla_put_failure" hidden inside the NLA_PUT() macro, but
we're holding the dcb_lock so we need to unlock first.

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
error27 authored and davem330 committed Jan 6, 2011
1 parent 0c66100 commit 70bfa2d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions net/dcb/dcbnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1264,9 +1264,14 @@ static int dcbnl_ieee_get(struct net_device *netdev, struct nlattr **tb,

spin_lock(&dcb_lock);
list_for_each_entry(itr, &dcb_app_list, list) {
if (strncmp(itr->name, netdev->name, IFNAMSIZ) == 0)
NLA_PUT(skb, DCB_ATTR_IEEE_APP,
sizeof(itr->app), &itr->app);
if (strncmp(itr->name, netdev->name, IFNAMSIZ) == 0) {
err = nla_put(skb, DCB_ATTR_IEEE_APP, sizeof(itr->app),
&itr->app);
if (err) {
spin_unlock(&dcb_lock);
goto nla_put_failure;
}
}
}
spin_unlock(&dcb_lock);
nla_nest_end(skb, app);
Expand Down

0 comments on commit 70bfa2d

Please sign in to comment.