diff options
author | Dan Carpenter <error27@gmail.com> | 2009-11-11 05:03:54 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-14 06:56:54 +0300 |
commit | d0490cfdf440fded2c292cfb8bb9272fc9ef6943 (patch) | |
tree | 6230f8a577136ca2d82d9d00cb36cf8b5a8ae3c3 /net | |
parent | b8a623bf836ccfab09a5a6daf62116f455082e6e (diff) | |
download | linux-d0490cfdf440fded2c292cfb8bb9272fc9ef6943.tar.xz |
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 <error27@gmail.com>
Acked-by: Wang Chen <ellre923@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ipmr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 630a56df7b47..99508d66a642 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); |