summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-04 12:41:08 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-04 12:41:08 +0200
commit51fc07d9ff864e06ce5a898c76d032c7187468bd (patch)
treeede618c361719fa8fe4c5ca9dab0ad664036f21a
parentc626c5fb7fe48729283e8e84dc55d0465b7c4924 (diff)
parent3fbbf2148a406b3e350fe91e6fdd78eb42ecad24 (diff)
downloadlinux-stable-51fc07d9ff864e06ce5a898c76d032c7187468bd.tar.gz
linux-stable-51fc07d9ff864e06ce5a898c76d032c7187468bd.tar.bz2
linux-stable-51fc07d9ff864e06ce5a898c76d032c7187468bd.zip
Merge tag 'soundwire-5.9-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-linus
Vinod writes: soundwire fixes for v5.8 This contains two fixes to sdw core for dangling pointer and a typo for INTSTAT register * tag 'soundwire-5.9-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: fix double free of dangling pointer soundwire: bus: fix typo in comment on INTSTAT registers
-rw-r--r--drivers/soundwire/bus.c2
-rw-r--r--drivers/soundwire/stream.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
index e6e0fb9a81b4..da0201693c24 100644
--- a/drivers/soundwire/bus.c
+++ b/drivers/soundwire/bus.c
@@ -1372,7 +1372,7 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
return ret;
}
- /* Read Instat 1, Instat 2 and Instat 3 registers */
+ /* Read Intstat 1, Intstat 2 and Intstat 3 registers */
ret = sdw_read(slave, SDW_SCP_INT1);
if (ret < 0) {
dev_err(slave->bus->dev,
diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
index 37290a799023..6e36deb505b1 100644
--- a/drivers/soundwire/stream.c
+++ b/drivers/soundwire/stream.c
@@ -717,6 +717,7 @@ error:
kfree(wbuf);
error_1:
kfree(wr_msg);
+ bus->defer_msg.msg = NULL;
return ret;
}
@@ -840,9 +841,10 @@ static int do_bank_switch(struct sdw_stream_runtime *stream)
error:
list_for_each_entry(m_rt, &stream->master_list, stream_node) {
bus = m_rt->bus;
-
- kfree(bus->defer_msg.msg->buf);
- kfree(bus->defer_msg.msg);
+ if (bus->defer_msg.msg) {
+ kfree(bus->defer_msg.msg->buf);
+ kfree(bus->defer_msg.msg);
+ }
}
msg_unlock: