U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* mtd: nand: pxa3xx: Null de-references with dev_err()
@ 2025-12-18  2:21 Chris Packham
  2025-12-18  4:49 ` Sean Anderson
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Packham @ 2025-12-18  2:21 UTC (permalink / raw)
  To: u-boot, Sean Anderson, Tom Rini, Miquel Raynal

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?

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

* Re: mtd: nand: pxa3xx: Null de-references with dev_err()
  2025-12-18  2:21 mtd: nand: pxa3xx: Null de-references with dev_err() Chris Packham
@ 2025-12-18  4:49 ` Sean Anderson
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Anderson @ 2025-12-18  4:49 UTC (permalink / raw)
  To: Chris Packham, u-boot, Tom Rini, Miquel Raynal

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

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

end of thread, other threads:[~2025-12-18  4:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-18  2:21 mtd: nand: pxa3xx: Null de-references with dev_err() Chris Packham
2025-12-18  4:49 ` Sean Anderson

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