[PATCHv2] serial: mxs-auart: fix probe error paths and clock handling

Greg Kroah-Hartman gregkh at linuxfoundation.org
Sun May 31 01:12:03 PDT 2026


On Sun, May 31, 2026 at 01:00:21AM -0700, Rosen Penev wrote:
> On Sun, May 31, 2026 at 12:52 AM Greg Kroah-Hartman
> <gregkh at linuxfoundation.org> wrote:
> >
> > On Sat, May 30, 2026 at 12:55:03PM -0700, Rosen Penev wrote:
> > > Sashiko reported three pre-existing bugs in the mxs-auart driver:
> > >
> > > - For non-ASM9260 variants, mxs_get_clks() obtained the clock but never
> > >   prepared/enabled it, leaving register accesses in probe at risk of
> > >   faulting if the bootloader had gated the clock.
> > > - The error path and remove function used pdev->id instead of
> > >   s->port.line to clear the auart_port[] slot.  For DT-probed devices
> > >   pdev->id is -1, causing an out-of-bounds write and leaving a dangling
> > >   pointer in the array.
> > > - The probe error path called iounmap() while the IRQ was still
> > >   registered. An interrupt during that window would dereference the
> > >   unmapped membase.
> >
> > This should still be broken up into smaller pieces, don't you think?
> >
> > Whenever you have to list the different things you do in a patch, that's
> > a huge hint to do so.
> I'll do so. Although I doubt the bot will be happy either way.

What bot?  Yours?  If so, please don't use it.



More information about the linux-arm-kernel mailing list