Re: [PATCH] fbdev: tdfxfb: fix PCI enable cleanup with pcim_enable_device()
Helge Deller <[email protected]> Sat, 18 Jul 2026 20:48:22 +0200
| Newsgroups | org.kernel.vger.linux-fbdev,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On 7/1/26 13:21, Myeonghun Pak wrote:
> tdfxfb_probe() enables the PCI device with pci_enable_device(), but
> several failure paths after that point return without disabling it. The
> framebuffer_alloc() failure path returns -ENOMEM directly, and the later
> shared out_err path releases the framebuffer and returns -ENXIO without
> balancing the PCI enable state.
>
> The successful probe path has the same imbalance because tdfxfb_remove()
> releases the framebuffer, mappings and regions, but never calls
> pci_disable_device().
>
> Use pcim_enable_device() so the PCI device is disabled automatically on
> probe failure and driver detach.
>
> This issue was identified during our ongoing static-analysis research while
> reviewing kernel code.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Co-developed-by: Ijae Kim <[email protected]>
> Signed-off-by: Ijae Kim <[email protected]>
> Signed-off-by: Myeonghun Pak <[email protected]>
> ---
> drivers/video/fbdev/tdfxfb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
applied.
Thanks!
Helge