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)
committerJakub Kicinski <kuba@kernel.org>
Thu, 27 Oct 2022 17:47:29 +0000 (10:47 -0700)
commita6aa8d0ce2cfba57ac0f23293fcb3be0b9f53fba
tree7078a8364f64a5652277d3d7a0c8daaf013d632d
parent6b1da9f7126f05e857da6db24c6a04aa7974d644
netdevsim: remove dir in nsim_dev_debugfs_init() when creating ports dir failed

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>
drivers/net/netdevsim/dev.c