diff options
author | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2021-10-12 11:15:21 +0100 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2021-10-20 20:54:59 +0530 |
commit | 4cbbe74d906be0bcffbe1e74b43a00f99626a69c (patch) | |
tree | 20d46b01b03289fc754b8becce9a9d35c9edcc75 /drivers/soundwire | |
parent | ccfdcb325f2a9fd188b89bcd43bb82680823201d (diff) | |
download | linux-4cbbe74d906be0bcffbe1e74b43a00f99626a69c.tar.gz linux-4cbbe74d906be0bcffbe1e74b43a00f99626a69c.tar.bz2 linux-4cbbe74d906be0bcffbe1e74b43a00f99626a69c.zip |
soundwire: bus: stop dereferencing invalid slave pointer
Slave pointer is invalid after end of list iteration, using this
would result in below Memory abort.
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000004
...
Call trace:
__dev_printk+0x34/0x7c
_dev_warn+0x6c/0x90
sdw_bus_exit_clk_stop+0x194/0x1d0
swrm_runtime_resume+0x13c/0x238
pm_generic_runtime_resume+0x2c/0x48
__rpm_callback+0x44/0x150
rpm_callback+0x6c/0x78
rpm_resume+0x314/0x558
rpm_resume+0x378/0x558
rpm_resume+0x378/0x558
__pm_runtime_resume+0x3c/0x88
Use bus->dev instead to print this error message.
Fixes: b50bb8ba369cd ("soundwire: bus: handle -ENODATA errors in clock stop/start sequences")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211012101521.32087-1-srinivas.kandagatla@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/soundwire')
-rw-r--r-- | drivers/soundwire/bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index 1b115734a8f6..67369e941d0d 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -1110,7 +1110,7 @@ int sdw_bus_exit_clk_stop(struct sdw_bus *bus) if (!simple_clk_stop) { ret = sdw_bus_wait_for_clk_prep_deprep(bus, SDW_BROADCAST_DEV_NUM); if (ret < 0) - dev_warn(&slave->dev, "clock stop deprepare wait failed:%d\n", ret); + dev_warn(bus->dev, "clock stop deprepare wait failed:%d\n", ret); } list_for_each_entry(slave, &bus->slaves, node) { |