summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2009-11-11 02:03:54 +0000
committerDavid S. Miller <davem@davemloft.net>2009-11-13 19:56:54 -0800
commitd0490cfdf440fded2c292cfb8bb9272fc9ef6943 (patch)
tree6230f8a577136ca2d82d9d00cb36cf8b5a8ae3c3 /net
parentb8a623bf836ccfab09a5a6daf62116f455082e6e (diff)
downloadlinux-d0490cfdf440fded2c292cfb8bb9272fc9ef6943.tar.bz2
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.c4
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);