Skip to content

Commit 352e669

Browse files
Zabelin Nikitapatjak
authored andcommitted
drm/gma500: Fix null dereference in hdmi teardown
pci_set_drvdata sets the value of pdev->driver_data to NULL, after which the driver_data obtained from the same dev is dereferenced in oaktrail_hdmi_i2c_exit, and the i2c_dev is extracted from it. To prevent this, swap these calls. Found by Linux Verification Center (linuxtesting.org) with Svacer. Fixes: 1b082cc ("gma500: Add Oaktrail support") Signed-off-by: Zabelin Nikita <[email protected]> Signed-off-by: Patrik Jakobsson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c7c31f8 commit 352e669

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/gma500/oaktrail_hdmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,8 @@ void oaktrail_hdmi_teardown(struct drm_device *dev)
726726

727727
if (hdmi_dev) {
728728
pdev = hdmi_dev->dev;
729-
pci_set_drvdata(pdev, NULL);
730729
oaktrail_hdmi_i2c_exit(pdev);
730+
pci_set_drvdata(pdev, NULL);
731731
iounmap(hdmi_dev->regs);
732732
kfree(hdmi_dev);
733733
pci_dev_put(pdev);

0 commit comments

Comments
 (0)