From: Dan Carpenter Date: Wed, 11 Nov 2009 02:03:54 +0000 (+0000) Subject: ipmr: missing dev_put() on error path in vif_add() X-Git-Tag: v2.6.32-rc8~10^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0490cfdf440fded2c292cfb8bb9272fc9ef6943;p=platform%2Fupstream%2Fkernel-adaptation-pc.git ipmr: missing dev_put() on error path in vif_add() The other error paths in front of this one have a dev_put() but this one got missed. Found by smatch static checker. Signed-off-by: Dan Carpenter Acked-by: Wang Chen Signed-off-by: David S. Miller --- diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 630a56d..99508d6 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c @@ -483,8 +483,10 @@ static int vif_add(struct net *net, struct vifctl *vifc, int mrtsock) 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);