Commit 80fceaf3 authored by Alexander Shishkin's avatar Alexander Shishkin Committed by Greg Kroah-Hartman

intel_th: Use correct method of finding hub

[ Upstream commit 9ad57708 ]

Since commit 8edc514b ("intel_th: Make SOURCE devices children of the
root device") the hub is not the parent of SOURCE devices any more, so the
new helper function should be used for that instead of always using the
parent. The intel_th_set_output() path, however, still uses the old
logic, leading to the hub driver structure being aliased with something
else, like struct pci_driver or struct acpi_driver, and an incorrect call
to an address inferred from that, potentially resulting in a crash.

Fixes: 8edc514b ("intel_th: Make SOURCE devices children of the root device")
Signed-off-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1366b31d
...@@ -935,7 +935,7 @@ EXPORT_SYMBOL_GPL(intel_th_trace_disable); ...@@ -935,7 +935,7 @@ EXPORT_SYMBOL_GPL(intel_th_trace_disable);
int intel_th_set_output(struct intel_th_device *thdev, int intel_th_set_output(struct intel_th_device *thdev,
unsigned int master) unsigned int master)
{ {
struct intel_th_device *hub = to_intel_th_device(thdev->dev.parent); struct intel_th_device *hub = to_intel_th_hub(thdev);
struct intel_th_driver *hubdrv = to_intel_th_driver(hub->dev.driver); struct intel_th_driver *hubdrv = to_intel_th_driver(hub->dev.driver);
if (!hubdrv->set_output) if (!hubdrv->set_output)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment