mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mmc: mmc_test: fix missing assignment of 'file' when register debugfs file
@ 2022-11-23  9:55 Ye Bin
  2022-11-23 10:54 ` Adrian Hunter
  2022-11-29 12:54 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Ye Bin @ 2022-11-23  9:55 UTC (permalink / raw)
  To: ulf.hansson, wsa+renesas, kvalo, adrian.hunter, linux-mmc
  Cc: linux-kernel, yebin10

From: Ye Bin <yebin10@huawei.com>

Now, 'file' is always NULL. obviously, 'file' is used to store return value of
'debugfs_create_file()'.

Fixes: a04c50aaa916 ("mmc: core: no need to check return value of debugfs_create functions")
Signed-off-by: Ye Bin <yebin10@huawei.com>
---
 drivers/mmc/core/mmc_test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c
index 6cd6f8a94a71..156d34b2ed4d 100644
--- a/drivers/mmc/core/mmc_test.c
+++ b/drivers/mmc/core/mmc_test.c
@@ -3174,7 +3174,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) {
-- 
2.31.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: mmc_test: fix missing assignment of 'file' when register debugfs file
  2022-11-23  9:55 [PATCH] mmc: mmc_test: fix missing assignment of 'file' when register debugfs file Ye Bin
@ 2022-11-23 10:54 ` Adrian Hunter
  2022-11-29 12:54 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Adrian Hunter @ 2022-11-23 10:54 UTC (permalink / raw)
  To: Ye Bin, ulf.hansson, wsa+renesas, kvalo, linux-mmc; +Cc: linux-kernel, yebin10

On 23/11/22 11:55, Ye Bin wrote:
> From: Ye Bin <yebin10@huawei.com>
> 
> Now, 'file' is always NULL. obviously, 'file' is used to store return value of
> 'debugfs_create_file()'.

'file' is used to remove 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>

> ---
>  drivers/mmc/core/mmc_test.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c
> index 6cd6f8a94a71..156d34b2ed4d 100644
> --- a/drivers/mmc/core/mmc_test.c
> +++ b/drivers/mmc/core/mmc_test.c
> @@ -3174,7 +3174,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) {


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: mmc_test: fix missing assignment of 'file' when register debugfs file
  2022-11-23  9:55 [PATCH] mmc: mmc_test: fix missing assignment of 'file' when register debugfs file Ye Bin
  2022-11-23 10:54 ` Adrian Hunter
@ 2022-11-29 12:54 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2022-11-29 12:54 UTC (permalink / raw)
  To: Ye Bin
  Cc: wsa+renesas, kvalo, adrian.hunter, linux-mmc, linux-kernel, yebin10

On Wed, 23 Nov 2022 at 10:34, Ye Bin <yebin@huaweicloud.com> wrote:
>
> From: Ye Bin <yebin10@huawei.com>
>
> Now, 'file' is always NULL. obviously, 'file' is used to store return value of
> 'debugfs_create_file()'.
>
> Fixes: a04c50aaa916 ("mmc: core: no need to check return value of debugfs_create functions")
> Signed-off-by: Ye Bin <yebin10@huawei.com>

Applied for fixes, by amending the commit message and by adding a
stable tag, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/core/mmc_test.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c
> index 6cd6f8a94a71..156d34b2ed4d 100644
> --- a/drivers/mmc/core/mmc_test.c
> +++ b/drivers/mmc/core/mmc_test.c
> @@ -3174,7 +3174,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) {
> --
> 2.31.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-29 12:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23  9:55 [PATCH] mmc: mmc_test: fix missing assignment of 'file' when register debugfs file Ye Bin
2022-11-23 10:54 ` Adrian Hunter
2022-11-29 12:54 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®