Re: [PATCH] serial: 8250_lpss: Fix memory leak in lpss8250_probe()

From: Andy Shevchenko
Date: Fri Apr 26 2024 - 11:38:05 EST


On Fri, Apr 26, 2024 at 06:32:33PM +0300, Dan Carpenter wrote:
> On Fri, Apr 26, 2024 at 05:45:49PM +0300, Andy Shevchenko wrote:
> > On Fri, Apr 26, 2024 at 04:53:18PM +0300, Dan Carpenter wrote:
> >
> > > > Fixes: e88c4cfcb7b888ac374916806f86c17d8ecaeb67
> > >
> > > This is the wrong hash and the format is wrong. It should be:
> > >
> > > Fixes: 254cc7743e84 ("serial: 8250_lpss: Switch over to MSI interrupts")
> >
> > Since you are here, just pay attention that this does NOT fix anything
> > as it uses pcim_enable_device(). I hope smatch won't stumble over this
> > and produce false positives.
> >
>
> Ah... No, this isn't a Smatch warning. I think I tried to add it but
> was told it was wrong because I have this in my unpublished code. :P
>
> // Are these affected by pcim_enable_device()?
> // { "pci_alloc_irq_vectors", ALLOC, 0, "$", &int_one, &int_max },
> // { "pci_free_irq_vectors", RELEASE, 0, "$" },
>
> So when we're using pcim_enable_device(), calling pci_free_irq_vectors()
> is harmless but not necessary?

Yes, precisely.

--
With Best Regards,
Andy Shevchenko