OSDN Git Service

net: ethernet: arc: Fix a potential memory leak if an optional regulator is deferred
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 18 Mar 2018 22:59:36 +0000 (23:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Mar 2018 16:11:34 +0000 (18:11 +0200)
commite9f83a8b4aaba8f458c244c7455f8a4ea31e8a28
tree050dc454025ccf0f070702a5a9b5a84c4ce8a4be
parent84fc2d7c220324000afb3559d9b4a0cea7066004
net: ethernet: arc: Fix a potential memory leak if an optional regulator is deferred

[ Upstream commit 00777fac28ba3e126b9e63e789a613e8bd2cab25 ]

If the optional regulator is deferred, we must release some resources.
They will be re-allocated when the probe function will be called again.

Fixes: 6eacf31139bf ("ethernet: arc: Add support for Rockchip SoC layer device tree bindings")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/arc/emac_rockchip.c