Re: [PATCH 5.10 100/122] gpio: mpc8xxx: Fix a potential double iounmap call in mpc8xxx_probe()

From: Greg Kroah-Hartman
Date: Wed Sep 22 2021 - 05:06:37 EST


On Wed, Sep 22, 2021 at 11:05:19AM +0200, Greg Kroah-Hartman wrote:
> On Tue, Sep 21, 2021 at 11:25:26PM +0200, Pavel Machek wrote:
> > Hi!
> >
> > > [ Upstream commit 7d6588931ccd4c09e70a08175cf2e0cf7fc3b869 ]
> > >
> > > Commit 76c47d1449fc ("gpio: mpc8xxx: Add ACPI support") has switched to a
> > > managed version when dealing with 'mpc8xxx_gc->regs'. So the corresponding
> > > 'iounmap()' call in the error handling path and in the remove should be
> > > removed to avoid a double unmap.
> >
> > This is wrong, AFAICT. 5.10 does not have 76c47d1449fc ("gpio:
> > mpc8xxx: Add ACPI support") so iounmap is still neccessary and this
> > adds a memory leak.
>
> Ah, but then I have to drop 889a1b3f35db ("gpio: mpc8xxx: Use
> 'devm_gpiochip_add_data()' to simplify the code and avoid a leak") from
> the 5.10 queue as it depends on this one.
>
> Can you provide a working backport of that commit so that I can queue up
> the fix?

Oh nevermind, I fixed it up myself.

greg k-h