From: sashiko-bot@kernel.org
To: "James Hilliard" <james.hilliard1@gmail.com>,
"Miquel Raynal" <miquel.raynal@bootlin.com>,
"Richard Weinberger" <richard@nod.at>,
"Vignesh Raghavendra" <vigneshr@ti.com>,
"Jens Axboe" <axboe@kernel.dk>, "Jan Kara" <jack@suse.cz>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtd: leave the device type unset when naming fails
Date: Sun, 08 Nov 2026 21:30:14 +0000 [thread overview]
Message-ID: <sashiko-outbox-204077@kernel.org> (raw)
In-Reply-To: <20261108-submit-mtd-devname-retry-v1-v1-1-a67f332c54dd@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] mtd: inaccurate Fixes tag in commit message for add_mtd_device()
--
commit e76bbebb3c54ac45bcccfcf9ff4a9021c3ac0eac
Author: James Hilliard <james.hilliard1@gmail.com>
> mtd: leave the device type unset when naming fails
>
> add_mtd_device() uses dev.type to reject a second registration of the
> same MTD. It sets that field before dev_set_name(), but the failure path
> for the name allocation leaves it set even though no device was
> registered. Retrying registration then warns and fails with -EEXIST.
>
> Set the type only after naming succeeds. The later registration error
> paths already clear it before releasing the device.
>
> Fixes: fa06052d637b ("mtd: Convert to dynamically allocated bdi infrastructure")
> Cc: stable@vger.kernel.org
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
[Severity: Low]
Should the Fixes tag reference 6697dae1e2da ("mtd: capture device name
setting failure when adding mtd") instead?
While fa06052d637b ("mtd: Convert to dynamically allocated bdi
infrastructure") changed the duplicate registration guard in
add_mtd_device() to check mtd->dev.type, dev_set_name() was not checked
for errors at that point. The fail_devname error path that returns before
device_register() with mtd->dev.type still set was introduced in
6697dae1e2da ("mtd: capture device name setting failure when adding mtd"),
and clearing mtd->dev.type on the fail_added path was added in
9d4af746af8c ("mtd: fix double free and WARN_ON in add_mtd_device() error
paths").
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261108-submit-mtd-devname-retry-v1-v1-1-a67f332c54dd@gmail.com?part=1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
prev parent reply other threads:[~2026-11-08 21:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-08 21:11 [PATCH] mtd: leave the device type unset when naming fails James Hilliard
2026-11-08 21:30 ` sashiko-bot [this message]
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=sashiko-outbox-204077@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=axboe@kernel.dk \
--cc=jack@suse.cz \
--cc=james.hilliard1@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=sashiko-reviews@lists.linux.dev \
--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