[soc:board-remove 200/200] drivers/mmc/host/sdhci-pxav2.c:318 sdhci_pxav2_probe() error: we previously assumed 'variant' could be null (see line 305)

Dan Carpenter error27 at gmail.com
Wed Aug 19 04:07:22 PDT 2026


On Wed, Aug 19, 2026 at 01:02:09PM +0200, Arnd Bergmann wrote:
> On Wed, Aug 19, 2026, at 09:54, Dan Carpenter wrote:
> > dfe9746aed2d12 Doug Brown            2023-01-16  304  	variant = 
> > of_device_get_match_data(dev);
> > dfe9746aed2d12 Doug Brown            2023-01-16 @305  	if (variant)
> >
> > This assumes "variant" can be NULL.
> >
> > dfe9746aed2d12 Doug Brown            2023-01-16  319  	host->ops = 
> > variant->ops;
> >
> > But later it's dereferenced without checking.
> >
> 
> Hi Dan,
> 
> Thanks for the report! I've fixed it up now, by removing the (now)
> pointless NULL check.
> 
> As you may have seen, there are a lot of changes in this branch,
> and I assume there are still many things that smatch will find here
> as it is still work in progress.
> 
> If you have a list of possible regressions that smatch has already
> found on this branch, I'd be happy to look through the raw data
> for actual bugs and fix them before you spend a lot of time
> processing the findings.

These are emails from zero day bot and I just look it over and hit
forward if the warning looks sane.  I'm re-writing Smatch like crazy
so my own results are basically useless right now.

regards,
dan carpenter




More information about the linux-arm-kernel mailing list