Re: [PATCH] PCI: endpoint: Fix a double free in __pci_epc_create()
From: Krzysztof Wilczyński
Date: Mon Jan 13 2025 - 19:57:49 EST
Hello,
> The put_device(&epc->dev) call will trigger pci_epc_release() which
> frees "epc" so the kfree(epc) on the next line is a double free.
>
> Found by code review.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 5e8cb4033807 ("PCI: endpoint: Add EP core layer to enable EP controller and EP functions")
> Signed-off-by: Ma Ke <make24@xxxxxxxxxxx>
Which kernel release did you review? I don't see this kfree() when looking
at the current code base per:
https://elixir.bootlin.com/linux/v6.13-rc1/source/drivers/pci/endpoint/pci-epc-core.c#L956-L1020
Krzysztof