]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/dcb/dcbnl.c
dcb: unlock on error in dcbnl_ieee_get()
[mv-sheeva.git] / net / dcb / dcbnl.c
index 9399af5657155a8bebc2768c2300d03e506137bc..4323bd441f0fb57b2db29e3cd914515fd1f96c29 100644 (file)
@@ -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);