Commit 723b68db authored by Gaosheng Cui's avatar Gaosheng Cui Committed by sanglipeng
Browse files

bnxt_en: Remove debugfs when pci_register_driver failed

stable inclusion
from stable-v5.10.156
commit d6a561bd4c53c5fc8cade48a555d3dc6acfb2c5b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7MCG1

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



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

[ Upstream commit 991aef4e ]

When pci_register_driver failed, we need to remove debugfs,
which will caused a resource leak, fix it.

Resource leak logs as follows:
[   52.184456] debugfs: Directory 'bnxt_en' with parent '/' already present!

Fixes: cabfb09d ("bnxt_en: add debugfs support for DIM")
Signed-off-by: default avatarGaosheng Cui <cuigaosheng1@huawei.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Reviewed-by: default avatarMichael Chan <michael.chan@broadcom.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 fcd12a85
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment