Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70bfa2d2 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller
Browse files

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: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0c661001
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -1264,9 +1264,14 @@ static int dcbnl_ieee_get(struct net_device *netdev, struct nlattr **tb,


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