Skip to content

Commit 51fc07d

Browse files
committed
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
2 parents c626c5f + 3fbbf21 commit 51fc07d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

drivers/soundwire/bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
13721372
return ret;
13731373
}
13741374

1375-
/* Read Instat 1, Instat 2 and Instat 3 registers */
1375+
/* Read Intstat 1, Intstat 2 and Intstat 3 registers */
13761376
ret = sdw_read(slave, SDW_SCP_INT1);
13771377
if (ret < 0) {
13781378
dev_err(slave->bus->dev,

drivers/soundwire/stream.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ static int sdw_bank_switch(struct sdw_bus *bus, int m_rt_count)
717717
kfree(wbuf);
718718
error_1:
719719
kfree(wr_msg);
720+
bus->defer_msg.msg = NULL;
720721
return ret;
721722
}
722723

@@ -840,9 +841,10 @@ static int do_bank_switch(struct sdw_stream_runtime *stream)
840841
error:
841842
list_for_each_entry(m_rt, &stream->master_list, stream_node) {
842843
bus = m_rt->bus;
843-
844-
kfree(bus->defer_msg.msg->buf);
845-
kfree(bus->defer_msg.msg);
844+
if (bus->defer_msg.msg) {
845+
kfree(bus->defer_msg.msg->buf);
846+
kfree(bus->defer_msg.msg);
847+
}
846848
}
847849

848850
msg_unlock:

0 commit comments

Comments
 (0)