]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
mmc: mmc_test: Fix removal of debugfs file
authorYe Bin <yebin10@huawei.com>
Wed, 23 Nov 2022 09:55:06 +0000 (17:55 +0800)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 14 Dec 2022 13:02:50 +0000 (14:02 +0100)
commit f4307b4df1c28842bb1950ff0e1b97e17031b17f upstream.

In __mmc_test_register_dbgfs_file(), we need to assign 'file', as it's
being used when removing the debugfs files when the mmc_test module is
removed.

Fixes: a04c50aaa916 ("mmc: core: no need to check return value of debugfs_create functions")
Signed-off-by: Ye Bin <yebin10@huawei.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: stable@vger.kernel.org
[Ulf: Re-wrote the commit msg]
Link: https://lore.kernel.org/r/20221123095506.1965691-1-yebin@huaweicloud.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 738946e35504f66dfda1978ec72d0253a434ffc0)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
drivers/mmc/core/mmc_test.c

index 63524551a13a16baa256428d9ac93ee461481edb..4052f828f75e73bec2aea9efc37e59c8616cc49a 100644 (file)
@@ -3181,7 +3181,8 @@ static int __mmc_test_register_dbgfs_file(struct mmc_card *card,
        struct mmc_test_dbgfs_file *df;
 
        if (card->debugfs_root)
-               debugfs_create_file(name, mode, card->debugfs_root, card, fops);
+               file = debugfs_create_file(name, mode, card->debugfs_root,
+                                          card, fops);
 
        df = kmalloc(sizeof(*df), GFP_KERNEL);
        if (!df) {