Skip to contentSkip to conversation

drm/gma500: Fix refcount leak in oaktrail_hdmi_setup

PATCH New Miaoqian Lin 1 participant 1 message Dec 11, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/gma500: Fix refcount leak in oaktrail_hdmi_setup

pci_get_device() increments the reference count on the PCI device. Add missing pci_dev_put() in error paths to fix refcount leak.

Found via static analysis and code review.

Fixes 1b082ccf5901 ("gma500: Add Oaktrail support")
---
 drivers/gpu/drm/gma500/oaktrail_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/gma500/oaktrail_hdmi.c +1 -1
index 20d027d552c7..2be12acc93d2 100644
@@ -712,10 +712,10 @@ void oaktrail_hdmi_setup(struct drm_device *dev)
 	dev_info(dev->dev, "HDMI hardware present.\n");
 
 	return;
-
 free:
 	kfree(hdmi_dev);
 out:
+	pci_dev_put(pdev);
 	return;
 }
 
Signature · 1 line
2.25.1