Skip to content

Commit 4bbfd1b

Browse files
Zabelin Nikitagregkh
authored andcommitted
drm/gma500: Fix null dereference in hdmi teardown
[ Upstream commit 352e669 ] 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 <n.zabelin@mt-integration.ru> Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Link: https://lore.kernel.org/r/20250918150703.2562604-1-n.zabelin@mt-integration.ru Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 0255a3b commit 4bbfd1b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/gma500/oaktrail_hdmi.c

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

725725
if (hdmi_dev) {
726726
pdev = hdmi_dev->dev;
727-
pci_set_drvdata(pdev, NULL);
728727
oaktrail_hdmi_i2c_exit(pdev);
728+
pci_set_drvdata(pdev, NULL);
729729
iounmap(hdmi_dev->regs);
730730
kfree(hdmi_dev);
731731
pci_dev_put(pdev);

0 commit comments

Comments
 (0)