fbdev/offb: fix PCI device reference leak on probe failure
PATCH 1/1 fbdev/offb: fix PCI device reference leak on probe failure
offb_init_nodriver() gets a referenced PCI device with pci_get_device(). If pci_enable_device() fails, the function returns without dropping that reference.
Release the PCI device reference before returning from the pci_enable_device() failure path.
--- drivers/video/fbdev/offb.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/video/fbdev/offb.c +6 -1
@@ -640,8 +640,13 @@ static void offb_init_nodriver(struct platform_device *parent, struct device_nod vid =be32_to_cpup (vidp); did =be32_to_cpup (didp); pdev =pci_get_device (vid, did,NULL ); -if (!pdev ||pci_enable_device (pdev)) +if (!pdev)return ; + +if (pci_enable_device (pdev)) { +pci_dev_put (pdev); +return ; + } }#endif /* kludge for valkyrie */
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 1/1 fbdev/offb: fix PCI device reference leak on probe failure
Dear Helge and Jason,
I am sending a gentle ping on this patch. Please let me know if you have any feedback or if any changes are required.
Best regards,
Yuho Choi
Helge Deller
maintainerQuoted 2 lines · On 5/5/26 03:39, [email protected] wrote:
I am sending a gentle ping on this patch. Please let me know if you have any feedback or if any changes are required.
Both of your patches (offb and savagefb) were merged upstream 13 days ago:
https://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev.git/log/?h=fbdev-7.1-2
Usually I send "patch applied" messages, but in this case I probably forgot.
Helge
Dear Helge,
Thanks for letting me know that the patches were merged.
Best regards,
Yuho Choi
Quoted 11 lines · Helge Deller
Quoted 2 lines · On 5/5/26 03:39, [email protected] wrote:
I am sending a gentle ping on this patch. Please let me know if you have any feedback or if any changes are required.
Both of your patches (offb and savagefb) were merged upstream 13 days ago:
https://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev.git/log/?h=fbdev-7.1-2Usually I send "patch applied" messages, but in this case I probably forgot.
Helge