diff options
author | Wentao Liang <Wentao_liang_g@163.com> | 2024-11-07 10:17:56 +0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-11-07 11:40:50 -0800 |
commit | 71712cf519faeed529549a79559c06c7fc250a15 (patch) | |
tree | 9a6b584bb6a75b0ebd089b482eae6f48efefa466 /drivers/net/ethernet | |
parent | d293958a8595ba566fb90b99da4d6263e14fee15 (diff) | |
download | lwn-71712cf519faeed529549a79559c06c7fc250a15.tar.gz lwn-71712cf519faeed529549a79559c06c7fc250a15.zip |
drivers: net: ionic: add missed debugfs cleanup to ionic_probe() error path
The ionic_setup_one() creates a debugfs entry for ionic upon
successful execution. However, the ionic_probe() does not
release the dentry before returning, resulting in a memory
leak.
To fix this bug, we add the ionic_debugfs_del_dev() to release
the resources in a timely manner before returning.
Fixes: 0de38d9f1dba ("ionic: extract common bits from ionic_probe")
Signed-off-by: Wentao Liang <Wentao_liang_g@163.com>
Acked-by: Shannon Nelson <shannon.nelson@amd.com>
Link: https://patch.msgid.link/20241107021756.1677-1-liangwentao@iscas.ac.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index b93791d6b593..f5dc876eb500 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -394,6 +394,7 @@ err_out_free_irqs: err_out_pci: ionic_dev_teardown(ionic); ionic_clear_pci(ionic); + ionic_debugfs_del_dev(ionic); err_out: mutex_destroy(&ionic->dev_cmd_lock); ionic_devlink_free(ionic); |