提交 d0490cfd 编写于 作者: D Dan Carpenter 提交者: 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: NDan Carpenter <error27@gmail.com>
Acked-by: NWang Chen <ellre923@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册