1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/intel/fm10k
Yuan Can 771a794c0a fm10k: Fix error handling in fm10k_init_module()
A problem about modprobe fm10k failed is triggered with the following log
given:

 Intel(R) Ethernet Switch Host Interface Driver
 Copyright(c) 2013 - 2019 Intel Corporation.
 debugfs: Directory 'fm10k' with parent '/' already present!

The reason is that fm10k_init_module() returns fm10k_register_pci_driver()
directly without checking its return value, if fm10k_register_pci_driver()
failed, it returns without removing debugfs and destroy workqueue,
resulting the debugfs of fm10k can never be created later and leaks the
workqueue.

 fm10k_init_module()
   alloc_workqueue()
   fm10k_dbg_init() # create debugfs
   fm10k_register_pci_driver()
     pci_register_driver()
       driver_register()
         bus_add_driver()
           priv = kzalloc(...) # OOM happened
   # return without remove debugfs and destroy workqueue

Fix by remove debugfs and destroy workqueue when
fm10k_register_pci_driver() returns error.

Fixes: 7461fd913a ("fm10k: Add support for debugfs")
Fixes: b382bb1b3e ("fm10k: use separate workqueue for fm10k driver")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2022-11-23 08:36:55 -08:00
..
fm10k.h fm10k: convert to new udp_tunnel_nic infra 2020-07-14 17:04:27 -07:00
fm10k_common.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
fm10k_common.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
fm10k_dcbnl.c intel: clean up mismatched header comments 2021-03-23 11:34:02 -07:00
fm10k_debugfs.c intel: clean up mismatched header comments 2021-03-23 11:34:02 -07:00
fm10k_ethtool.c ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
fm10k_iov.c fm10k: add support for ndo_get_vf_stats operation 2019-11-04 13:12:14 -08:00
fm10k_main.c fm10k: Fix error handling in fm10k_init_module() 2022-11-23 08:36:55 -08:00
fm10k_mbx.c fm10k: remove unexpected word "the" 2022-06-30 10:42:00 -07:00
fm10k_mbx.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
fm10k_netdev.c ethernet: use eth_hw_addr_set() instead of ether_addr_copy() 2021-10-02 14:18:25 +01:00
fm10k_pci.c ethernet: use eth_hw_addr_set() instead of ether_addr_copy() 2021-10-02 14:18:25 +01:00
fm10k_pf.c intel: clean up mismatched header comments 2021-03-23 11:34:02 -07:00
fm10k_pf.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
fm10k_tlv.c intel/fm10k:fix repeated words in comments 2022-06-30 10:56:01 -07:00
fm10k_tlv.h fm10k: add missing field initializers to TLV attributes) 2019-11-04 13:12:14 -08:00
fm10k_type.h fm10k: add support for ndo_get_vf_stats operation 2019-11-04 13:12:14 -08:00
fm10k_vf.c fm10k: mark unused parameters with __always_unused 2019-08-04 04:36:49 -07:00
fm10k_vf.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
Makefile net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00