public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Edward Adam Davis <eadavis@qq.com>
Cc: syzbot+074732af3fc6c528f8a0@syzkaller.appspotmail.com,
	linux-kernel@vger.kernel.org,  linux-mtd@lists.infradead.org,
	richard@nod.at,  syzkaller-bugs@googlegroups.com,
	 vigneshr@ti.com
Subject: Re: [PATCH] mtd: capture device name setting failure when adding mtd
Date: Thu, 06 Feb 2025 17:58:37 +0100	[thread overview]
Message-ID: <87ikpn57sy.fsf@bootlin.com> (raw)
In-Reply-To: <tencent_B7365D9CDDA8990DCF8C0DFE25B28DB31207@qq.com> (Edward Adam Davis's message of "Sun, 2 Feb 2025 09:31:45 +0800")

Hello Edward,

> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> index 724f917f91ba..a71cd75858e4 100644
> --- a/drivers/mtd/mtdcore.c
> +++ b/drivers/mtd/mtdcore.c
> @@ -741,7 +741,8 @@ int add_mtd_device(struct mtd_info *mtd)
>  	mtd->dev.type = &mtd_devtype;
>  	mtd->dev.class = &mtd_class;
>  	mtd->dev.devt = MTD_DEVT(i);
> -	dev_set_name(&mtd->dev, "mtd%d", i);
> +	if (error = dev_set_name(&mtd->dev, "mtd%d", i))

Thanks a lot for the analyse and for fixing this. May I ask however to
follow a more common pattern for error checking that is:

       error = dev_set_name(...);
       if (error)
                goto...

This way it is closer to the usual error handling and also aligned with
the rest of the file.

Otherwise LGTM.

Thanks,
Miquèl

  reply	other threads:[~2025-02-06 16:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-31 13:54 [syzbot] [mtd?] WARNING in release_mtd_partition syzbot
2025-02-02  0:45 ` Edward Adam Davis
2025-02-02  1:01   ` syzbot
2025-02-02  1:10 ` Edward Adam Davis
2025-02-02  1:32   ` syzbot
2025-02-02  1:31 ` [PATCH] mtd: capture device name setting failure when adding mtd Edward Adam Davis
2025-02-06 16:58   ` Miquel Raynal [this message]
2025-02-07 12:10     ` [PATCH V2] " Edward Adam Davis
2025-02-07 14:46       ` Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ikpn57sy.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=eadavis@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=syzbot+074732af3fc6c528f8a0@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox