Re: [PATCH] pinctrl: freescale: imx: Use 'devm_of_iomap()' to avoid a resource leak in case of error in 'imx_pinctrl_probe()'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jun 13, 2020 at 08:49:54AM -0700, Guenter Roeck wrote:
> On Tue, Jun 02, 2020 at 10:06:26PM +0200, Christophe JAILLET wrote:
> > Use 'devm_of_iomap()' instead 'of_iomap()' to avoid a resource leak in
> > case of error.
> > 
> > Update the error handling code accordingly.
> > 
> > Fixes: 26d8cde5260b ("pinctrl: freescale: imx: add shared input select reg support")
> > Suggested-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> > Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> 
> When booting mcimx7d-sabre in qemu, his patch results in:
> 
> [    1.835341] imx7d-pinctrl 302c0000.iomuxc-lpsr: initialized IMX pinctrl driver
> [    1.839702] imx7d-pinctrl 30330000.pinctrl: can't request region for resource [mem 0x30330000-0x3033ffff]
> [    1.840261] imx7d-pinctrl: probe of 30330000.pinctrl failed with error -16

Yeah.  Sorry about that.  We had to revert that patch.

The problem is that that devm_of_iomap() tracks if the regions are
already used and of_iomap() does not.  In this case there were two
places mapping the same memory.  I added a comment about that to the
devm_of_iomap() so hopefully we won't introduce bugs like this in the
future.

regards,
dan carpenter





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux