Yuan Can 8eab9be56c net: hinic: Fix error handling in hinic_module_init()
A problem about hinic create debugfs failed is triggered with the
following log given:

 [  931.419023] debugfs: Directory 'hinic' with parent '/' already present!

The reason is that hinic_module_init() returns pci_register_driver()
directly without checking its return value, if pci_register_driver()
failed, it returns without destroy the newly created debugfs, resulting
the debugfs of hinic can never be created later.

 hinic_module_init()
   hinic_dbg_register_debugfs() # create debugfs directory
   pci_register_driver()
     driver_register()
       bus_add_driver()
         priv = kzalloc(...) # OOM happened
   # return without destroy debugfs directory

Fix by removing debugfs when pci_register_driver() returns error.

Fixes: 253ac3a97921 ("hinic: add support to query sq info")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20221110021642.80378-1-yuancan@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-11-11 19:57:37 -08:00
..
2022-11-07 10:19:04 -08:00
2022-10-10 09:10:28 -07:00
2022-10-12 10:23:24 -07:00
2022-11-05 09:02:28 -07:00
2022-11-04 16:03:43 -07:00
2022-10-14 18:41:41 -07:00
2022-10-21 17:41:57 -07:00
2022-10-10 13:59:01 -07:00
2022-09-21 20:33:49 +02:00
2022-10-11 10:53:25 -07:00
2022-10-12 10:23:24 -07:00
2022-10-09 14:05:15 -07:00
2022-10-14 18:41:41 -07:00
2022-10-29 18:06:52 -07:00
2022-10-10 13:13:51 -07:00
2022-10-14 12:38:03 -07:00
2022-11-07 10:19:04 -08:00
2022-10-10 09:10:28 -07:00
2022-10-07 11:32:10 -07:00
2022-10-07 11:24:20 -07:00
2022-10-29 18:12:45 -07:00
2022-10-26 17:38:46 -07:00
2022-10-22 15:30:15 -07:00
2022-10-22 03:29:32 +00:00
2022-10-30 11:31:14 -07:00
2022-10-10 14:02:53 -07:00
2022-10-12 14:46:48 -07:00
2022-10-10 14:02:53 -07:00
2022-10-30 11:31:14 -07:00
2022-11-01 12:21:53 -07:00
2022-10-21 14:43:09 -07:00