public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] fbdev/offb: fix PCI device reference leak on probe failure
@ 2026-04-20  1:01 Yuho Choi
  2026-05-05  1:39 ` dbgh9129
  0 siblings, 1 reply; 4+ messages in thread
From: Yuho Choi @ 2026-04-20  1:01 UTC (permalink / raw)
  To: Helge Deller, Jason Donenfeld, linux-fbdev
  Cc: dri-devel, linux-kernel, Myeonghun Pak, Ijae Kim, Taegyu Kim,
	Yuho Choi

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.

Fixes: 5bda8f7b5468 ("video: fbdev: offb: Call pci_enable_device() before using the PCI VGA device")
Co-developed-by: Myeonghun Pak <mhun512@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Co-developed-by: Taegyu Kim <tmk5904@psu.edu>
Signed-off-by: Taegyu Kim <tmk5904@psu.edu>
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
---
 drivers/video/fbdev/offb.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c
index f85428e13996b..166b2dff36f59 100644
--- a/drivers/video/fbdev/offb.c
+++ b/drivers/video/fbdev/offb.c
@@ -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 */
-- 
2.50.1 (Apple Git-155)


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v1] fbdev/offb: fix PCI device reference leak on probe failure
  2026-04-20  1:01 [PATCH v1] fbdev/offb: fix PCI device reference leak on probe failure Yuho Choi
@ 2026-05-05  1:39 ` dbgh9129
  2026-05-05 10:10   ` Helge Deller
  0 siblings, 1 reply; 4+ messages in thread
From: dbgh9129 @ 2026-05-05  1:39 UTC (permalink / raw)
  To: deller, Jason, linux-fbdev
  Cc: dri-devel, linux-kernel, mhun512, ae878000, tmk5904, dbgh9129

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] fbdev/offb: fix PCI device reference leak on probe failure
  2026-05-05  1:39 ` dbgh9129
@ 2026-05-05 10:10   ` Helge Deller
  2026-05-05 11:22     ` 최유호
  0 siblings, 1 reply; 4+ messages in thread
From: Helge Deller @ 2026-05-05 10:10 UTC (permalink / raw)
  To: dbgh9129, Jason, linux-fbdev
  Cc: dri-devel, linux-kernel, mhun512, ae878000, tmk5904

On 5/5/26 03:39, dbgh9129@gmail.com 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] fbdev/offb: fix PCI device reference leak on probe failure
  2026-05-05 10:10   ` Helge Deller
@ 2026-05-05 11:22     ` 최유호
  0 siblings, 0 replies; 4+ messages in thread
From: 최유호 @ 2026-05-05 11:22 UTC (permalink / raw)
  To: Helge Deller
  Cc: Jason, linux-fbdev, dri-devel, linux-kernel, mhun512, ae878000,
	tmk5904

Dear Helge,

Thanks for letting me know that the patches were merged.

Best regards,
Yuho Choi

On Tue, 5 May 2026 at 06:10, Helge Deller <deller@gmx.de> wrote:
>
> On 5/5/26 03:39, dbgh9129@gmail.com 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-05 11:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20  1:01 [PATCH v1] fbdev/offb: fix PCI device reference leak on probe failure Yuho Choi
2026-05-05  1:39 ` dbgh9129
2026-05-05 10:10   ` Helge Deller
2026-05-05 11:22     ` 최유호

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox