From: Dan Carpenter Date: Tue, 4 Jan 2011 21:03:12 +0000 (+0000) Subject: dcb: unlock on error in dcbnl_ieee_get() X-Git-Tag: v2.6.38-rc1~476^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70bfa2d2e1bfd90ef26758b5e2749f043a940037;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git dcb: unlock on error in dcbnl_ieee_get() 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 Signed-off-by: David S. Miller --- diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index 9399af5..4323bd4 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c @@ -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);