Skip to content
Commit ac26692f authored by Wang Hai's avatar Wang Hai Committed by Greg Kroah-Hartman
Browse files

net: smc91x: Fix possible memory leak in smc_drv_probe()

[ Upstream commit bca9749b ]

If try_toggle_control_gpio() failed in smc_drv_probe(), free_netdev(ndev)
should be called to free the ndev created earlier. Otherwise, a memleak
will occur.

Fixes: 7d2911c4

 ("net: smc91x: Fix gpios for device tree based booting")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 2781ec63
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