1
0
Fork 0

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>
hifive-unleashed-5.1
Dan Carpenter 2009-11-11 02:03:54 +00:00 committed by David S. Miller
parent b8a623bf83
commit d0490cfdf4
1 changed files with 3 additions and 1 deletions

View File

@ -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);