netdevsim: remove dir in nsim_dev_debugfs_init() when creating ports dir failed
authorZhengchao Shao <shaozhengchao@huawei.com>
Wed, 26 Oct 2022 01:46:42 +0000 (09:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 14:59:19 +0000 (23:59 +0900)
commiteefa97a7a0019b9c015d963d3b9f2e3e2716e698
treefb470938bd41748ba2adc26731132b92c5a69111
parentc9589e18a60c55c76772a38117ef9a16b942e56b
netdevsim: remove dir in nsim_dev_debugfs_init() when creating ports dir failed

[ Upstream commit a6aa8d0ce2cfba57ac0f23293fcb3be0b9f53fba ]

Remove dir in nsim_dev_debugfs_init() when creating ports dir failed.
Otherwise, the netdevsim device will not be created next time. Kernel
reports an error: debugfs: Directory 'netdevsim1' with parent 'netdevsim'
already present!

Fixes: ab1d0cc004d7 ("netdevsim: change debugfs tree topology")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/netdevsim/dev.c