U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Anderson <seanga2@gmail.com>
To: Chris Packham <judge.packham@gmail.com>,
	u-boot <u-boot@lists.denx.de>, Tom Rini <trini@konsulko.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>
Subject: Re: mtd: nand: pxa3xx: Null de-references with dev_err()
Date: Wed, 17 Dec 2025 23:49:35 -0500	[thread overview]
Message-ID: <f44d25fc-2eb9-af08-7a28-737f1bf510ca@gmail.com> (raw)
In-Reply-To: <CAFOYHZBuWrLk4LfDa2dysvdHUMH7ziDicA9a+usPaYQnKc1O2A@mail.gmail.com>

On 12/17/25 21:21, Chris Packham wrote:
> Hi All,
> 
> Sorry this isn't a patch but I've just stumbled across a problem and
> I'm not sure how to deal with it.
> 
> In commit 661c98121d49 ("mtd: nand: pxa3xx: Fix not calling dev_xxx
> with a device") Sean updated some code to pass a valid device to
> dev_err(). Most of the places had a struct mtd_info * with an
> appropriate member. A few didn't and Sean used
> info->controller.active->mtd.dev instead but it looks like
> controller.active is only assigned via panic_nand_get_device() which
> I'm not sure is ever actually called in u-boot. Being that the
> offending calls are only in error cases I'm guessing no-one else has
> stumbled across them.
> 
> I'm a little unsure what to do here. Some of the uses of
> info->controller.active->mtd.dev are close enough to a struct mtd_info
> * that I can just pass that in. But others are buried deep and it
> would be quite invasive to add. I could add a dev member to struct
> pxa3xx_nand_info. Or just change the dev_err to pr_err instead.
> 
> Any preference?

I'd just add a dev member to nand_info.

--Sean

      reply	other threads:[~2025-12-18  4:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-18  2:21 mtd: nand: pxa3xx: Null de-references with dev_err() Chris Packham
2025-12-18  4:49 ` Sean Anderson [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=f44d25fc-2eb9-af08-7a28-737f1bf510ca@gmail.com \
    --to=seanga2@gmail.com \
    --cc=judge.packham@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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