[patch] missing dev_put() on error path in vif_add()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dan Carpenter
Date: Wednesday, November 11, 2009 - 5:03 am

The other error paths in front of this one have a dev_put() but this one 
got missed.

Found by smatch static checker.

regards,
dan carpenter

Signed-off-by: Dan Carpenter <error27@gmail.com>

--- orig/net/ipv4/ipmr.c	2009-11-11 13:34:20.000000000 +0200
+++ devel/net/ipv4/ipmr.c	2009-11-11 13:34:59.000000000 +0200
@@ -483,8 +483,10 @@
 		return -EINVAL;
 	}
 
-	if ((in_dev = __in_dev_get_rtnl(dev)) == NULL)
+	if ((in_dev = __in_dev_get_rtnl(dev)) == NULL) {
+		dev_put(dev);
 		return -EADDRNOTAVAIL;
+	}
 	IPV4_DEVCONF(in_dev->cnf, MC_FORWARDING)++;
 	ip_rt_multicast_event(in_dev);
 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch] missing dev_put() on error path in vif_add(), Dan Carpenter, (Wed Nov 11, 5:03 am)