Commit 5ec1f905 authored by Yuan Can's avatar Yuan Can Committed by sanglipeng
Browse files

net: net_netdev: Fix error handling in ntb_netdev_init_module()

stable inclusion
from stable-v5.10.158
commit b080d4668f3f00298077ab32ec50b1128239d421
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7NTXH

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b080d4668f3f00298077ab32ec50b1128239d421



--------------------------------

[ Upstream commit b8f79dcc ]

The ntb_netdev_init_module() returns the ntb_transport_register_client()
directly without checking its return value, if
ntb_transport_register_client() failed, the NTB client device is not
unregistered.

Fix by unregister NTB client device when ntb_transport_register_client()
failed.

Fixes: 548c237c ("net: Add support for NTB virtual ethernet device")
Signed-off-by: default avatarYuan Can <yuancan@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 3f3d1b93
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment