[PATCH 2/2] soc: imx: imx8mp-blk-ctrl: Fix NULL pointer dereference

Marco Felsch m.felsch at pengutronix.de
Mon Dec 19 01:14:03 PST 2022


On 22-12-18, Marek Vasut wrote:
> On 12/18/22 14:29, Adam Ford wrote:
> 
> Hi,
> 
> > > > > > diff --git a/drivers/soc/imx/imx8mp-blk-ctrl.c b/drivers/soc/imx/imx8mp-blk-ctrl.c
> > > > > > index b7d4161fcda9c..916bf0b3bc975 100644
> > > > > > --- a/drivers/soc/imx/imx8mp-blk-ctrl.c
> > > > > > +++ b/drivers/soc/imx/imx8mp-blk-ctrl.c
> > > > > > @@ -553,7 +553,7 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
> > > > > > 
> > > > > >              domain->power_dev =
> > > > > >                      dev_pm_domain_attach_by_name(dev, data->gpc_name);
> > > > > > -           if (IS_ERR(domain->power_dev)) {
> > > > > > +           if (IS_ERR_OR_NULL(domain->power_dev)) {
> > > > > >                      dev_err_probe(dev, PTR_ERR(domain->power_dev),
> > > > > >                                    "failed to attach power domain %s\n",
> > > > > >                                    data->gpc_name);
> > > > > 
> > > > > Same problem as with the other patch, you shouldn't use 0 as error
> > > > > value.
> > > > 
> > > > This and IIRC Lucas already had a patch to fix.
> > > 
> > > Seems there is a fix for 8m-blk-ctrl, not 8mp , but the fix would then
> > > be identical.
> > 
> > I think this might be the patch from Lucas that Marco was referencing:
> > 
> > https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=671618&archive=both&state=*
> 
> Since Linux 6.1 does not even boot on i.MX8MP and crashes before even
> printing anything on console (unless you use earlycon), it would be good to
> apply the 1/3 or "[PATCH] soc: imx: imx8mp-blk-ctrl: Do not set power domain
> name" I sent yesterday.

Or just pick
https://patchwork.kernel.org/project/linux-arm-kernel/patch/20220826191305.3215706-1-l.stach@pengutronix.de/
which has already Peng's review. Up to the maintainer which he want to
use but we should fix that.

Regards,
  Marco



More information about the linux-arm-kernel mailing list