summaryrefslogtreecommitdiffstats
path: root/net/dcb/dcbnl.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2011-01-04 22:03:12 +0100
committerDavid S. Miller <davem@davemloft.net>2011-01-06 20:16:54 +0100
commit70bfa2d2e1bfd90ef26758b5e2749f043a940037 (patch)
treea6dd525ad85e1fe1b95a906f8b9fa50c7f275bdb /net/dcb/dcbnl.c
parentnet: ixp4xx_eth: Return proper error for eth_init_one (diff)
downloadlinux-70bfa2d2e1bfd90ef26758b5e2749f043a940037.tar.xz
linux-70bfa2d2e1bfd90ef26758b5e2749f043a940037.zip
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 <error27@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dcb/dcbnl.c')
-rw-r--r--net/dcb/dcbnl.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 9399af565715..4323bd441f0f 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);