Skip to contentSkip to conversation

ieee802154: missing put_dev() on error

PATCH Applied Dan Carpenter 2 participants 2 messages May 22, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ieee802154: missing put_dev() on error

We should call put_dev() on the error path here.

Fixes 3e9c156e2c21 ('ieee802154: add netlink interfaces for llsec')

---
Applies to -next

net/ieee802154/nl-mac.c +4 -2
index 5617b4c..a3281b8 100644
@@ -832,8 +832,10 @@ int ieee802154_llsec_getparams(struct sk_buff *skb, struct genl_info *info)
 		return -ENODEV;
 
 	ops = ieee802154_mlme_ops(dev);
-	if (!ops->llsec)
-		return -EOPNOTSUPP;
+	if (!ops->llsec) {
+		rc = -EOPNOTSUPP;
+		goto out_dev;
+	}
 
 	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
 	if (!msg)