Skip to contentSkip to conversation

drm/tegra: output: Do not put OF node twice

PATCH In review Thierry Reding 3 participants 3 messages Nov 13, 2020 – Nov 15, 2020

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

PATCH 1/1 drm/tegra: output: Do not put OF node twice

From: Thierry Reding <[email protected]>

The original patch for commit 3d2e7aec7013 ("drm/tegra: output: Don't leak OF node on error") contained this hunk, but it was accidentally dropped during conflict resolution. This causes use-after-free errors on devices that use an I2C controller for HDMI DDC/CI on Tegra210 and later.

Fixes 3d2e7aec7013 ("drm/tegra: output: Don't leak OF node on error")
---
 drivers/gpu/drm/tegra/output.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/tegra/output.c +0 -1
index 5a4fd0dbf4cf..47d26b5d9945 100644
@@ -129,7 +129,6 @@ int tegra_output_probe(struct tegra_output *output)
 
 		if (!output->ddc) {
 			err = -EPROBE_DEFER;
-			of_node_put(ddc);
 			return err;
 		}
 	}
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw

Hi Thierry,

Quoted 10 lines · Thierry Reding

From: Thierry Reding <[email protected]>

The original patch for commit 3d2e7aec7013 ("drm/tegra: output: Don't leak OF node on error") contained this hunk, but it was accidentally dropped during conflict resolution. This causes use-after-free errors on devices that use an I2C controller for HDMI DDC/CI on Tegra210 and later.

Fixes 3d2e7aec7013 ("drm/tegra: output: Don't leak OF node on error")

Two times of_node_put() of the same pointer looks bad.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by on v1 1/1
#2 lore raw
In reply to Thierry Reding

13.11.2020 23:41, Thierry Reding пишет:

Quoted 20 lines

From: Thierry Reding <[email protected]>

The original patch for commit 3d2e7aec7013 ("drm/tegra: output: Don't leak OF node on error") contained this hunk, but it was accidentally dropped during conflict resolution. This causes use-after-free errors on devices that use an I2C controller for HDMI DDC/CI on Tegra210 and later.

Fixes 3d2e7aec7013 ("drm/tegra: output: Don't leak OF node on error")
---
 drivers/gpu/drm/tegra/output.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/tegra/output.c +0 -0
index 5a4fd0dbf4cf..47d26b5d9945 100644

drivers/gpu/drm/tegra/output.c int tegra_output_probe(struct tegra_output *output) · line 134

Quoted 7 lines
drivers/gpu/drm/tegra/output.c +0 -1
@@ -129,7 +129,6 @@ int tegra_output_probe(struct tegra_output *output)
 
 		if (!output->ddc) {
 			err = -EPROBE_DEFER;
-			of_node_put(ddc);
 			return err;
 		}
 	}