Skip to content

Commit

Permalink
ipmr: missing dev_put() on error path in vif_add()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Nov 14, 2009
1 parent b8a623b commit d0490cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ipv4/ipmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit d0490cf

Please sign in to comment.