]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hinic: fix a bug of ndo_stop
authorLuo bin <luobin9@huawei.com>
Sun, 10 May 2020 19:01:08 +0000 (19:01 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 May 2020 06:18:37 +0000 (08:18 +0200)
commit2afbedce318458d6eed6f0cf6cf0857215f3c3af
treef309ce194893054e39c7e681df090c5526603b94
parent791195cc821f0d5cc8c86ec25d4c9aeca92c5fa6
hinic: fix a bug of ndo_stop

[ Upstream commit e8a1b0efd632d1c9db7d4e93da66377c7b524862 ]

if some function in ndo_stop interface returns failure because of
hardware fault, must go on excuting rest steps rather than return
failure directly, otherwise will cause memory leak.And bump the
timeout for SET_FUNC_STATE to ensure that cmd won't return failure
when hw is busy. Otherwise hw may stomp host memory if we free
memory regardless of the return value of SET_FUNC_STATE.

Fixes: 51ba902a16e6 ("net-next/hinic: Initialize hw interface")
Signed-off-by: Luo bin <luobin9@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c
drivers/net/ethernet/huawei/hinic/hinic_main.c