Re: [PATCH v4] uio: uio_pci_generic_sva: fix double free of devm_kzalloc() memory

From: Guangshuo Li

Date: Tue May 05 2026 - 10:58:35 EST


Hi Greg,

Thanks for reviewing.

On Thu, 2 Apr 2026 at 21:52, Greg Kroah-Hartman
<gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> Breaks the build, how did you test this:
> CC [M] drivers/uio/uio_pci_generic_sva.o
> drivers/uio/uio_pci_generic_sva.c:147:26: error: unused variable 'udev' [-Werror,-Wunused-variable]
> 147 | struct uio_pci_sva_dev *udev = pci_get_drvdata(pdev);
> | ^~~~
> 1 error generated.
>
> {sigh}

Sorry, I missed the now-unused local variable in remove() after removing
the kfree() call.

I will send a v5 which also removes the pci_get_drvdata() assignment from
remove(), and I will make sure it builds before resending.

Thanks for catching this.