]> www.infradead.org Git - users/hch/misc.git/commitdiff
drivers: net: ionic: add missed debugfs cleanup to ionic_probe() error path
authorWentao Liang <Wentao_liang_g@163.com>
Thu, 7 Nov 2024 02:17:56 +0000 (10:17 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 7 Nov 2024 19:40:50 +0000 (11:40 -0800)
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>
drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c

index b93791d6b59332f100a8078949a3f8e3ce71a12e..f5dc876eb50099210e320f75c018af666d689f38 100644 (file)
@@ -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);