Fix for refcount leak.

Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2017-09-16 16:27:24 +00:00
parent d18b4113ed
commit 6af166cc7b

View File

@ -1246,8 +1246,12 @@ static bool validate_ipv4_net_dev(struct net_device *net_dev,
return false;
src_dev = ip_dev_find(net_dev->if_vnet, saddr);
if (src_dev != net_dev)
if (src_dev != net_dev) {
if (src_dev != NULL)
dev_put(src_dev);
return false;
}
dev_put(src_dev);
/*
* Make sure the socket address length field