[PATCH v2] soc: brcmstb: pm-arm: Fix refcount leak and __iomem leak bugs

Arnd Bergmann arnd at arndb.de
Wed Jul 6 07:51:50 PDT 2022


On Wed, Jul 6, 2022 at 4:30 PM Liang He <windhl at 126.com> wrote:
> >
> >I think the driver is confusing because it only supports a single instance and
> >stores the data in a global 'ctrl' structure. When you get into the probe
> >function, the value here should always be '0'. This also means it won't
> >work correctly when it runs across deferred probing (you can ignore that
> >bug, but maybe someone else should address this).
> >
> >Removing the 'j' variable from the function would make this more readable.
>
> >
>
> Hi, Arnd,
>
> Based on your explaination, removing 'j' also means following patch 'for (i = j; i < ctrl.num_memc; i++)' to release
> 'ctrl.memcs[i].ddr_shimphy_base' should start from i=0, right?
>

Yes, exactly.

        Arnd



More information about the linux-arm-kernel mailing list