Browse Source

net/ncsi: unlock on error in ncsi_set_interface_nl()

There are two error paths which are missing unlocks in this function.

Fixes: 955dc68cb9b2 ("net/ncsi: Add generic netlink family")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Dan Carpenter 7 years ago
parent
commit
054f34da60
1 changed files with 2 additions and 0 deletions
  1. 2 0
      net/ncsi/ncsi-netlink.c

+ 2 - 0
net/ncsi/ncsi-netlink.c

@@ -299,6 +299,7 @@ static int ncsi_set_interface_nl(struct sk_buff *msg, struct genl_info *info)
 			package = np;
 			package = np;
 	if (!package) {
 	if (!package) {
 		/* The user has set a package that does not exist */
 		/* The user has set a package that does not exist */
+		spin_unlock_irqrestore(&ndp->lock, flags);
 		return -ERANGE;
 		return -ERANGE;
 	}
 	}
 
 
@@ -317,6 +318,7 @@ static int ncsi_set_interface_nl(struct sk_buff *msg, struct genl_info *info)
 		/* The user has set a channel that does not exist on this
 		/* The user has set a channel that does not exist on this
 		 * package
 		 * package
 		 */
 		 */
+		spin_unlock_irqrestore(&ndp->lock, flags);
 		netdev_info(ndp->ndev.dev, "NCSI: Channel %u does not exist!\n",
 		netdev_info(ndp->ndev.dev, "NCSI: Channel %u does not exist!\n",
 			    channel_id);
 			    channel_id);
 		return -ERANGE;
 		return -ERANGE;