Commit d0490cfd authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

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: default avatarDan Carpenter <error27@gmail.com>
Acked-by: default avatarWang Chen <ellre923@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b8a623bf
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment