]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
soundwire: cadence: Don't overwrite msg->buf during write commands
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Fri, 16 Sep 2022 10:35:05 +0000 (11:35 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 24 Nov 2022 13:25:04 +0000 (14:25 +0100)
commitb1eb9a999d8e0266b0d93dadcc132f6d3c8f1c7e
tree76e3b6151b312b0ab1abcd076b2f5f98523dbb8e
parent3760b911fc61a188eaededcb1c784d08de94d6e0
soundwire: cadence: Don't overwrite msg->buf during write commands

BugLink: https://bugs.launchpad.net/bugs/1996825
[ Upstream commit ba05b39d265bdd16913f7684600d9d41e2796745 ]

The buf passed in struct sdw_msg must only be written for a READ,
in that case the RDATA part of the response is the data value of the
register.

For a write command there is no RDATA, and buf should be assumed to
be const and unmodifable. The original caller should not expect its data
buffer to be corrupted by an sdw_nwrite().

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220916103505.1562210-1-rf@opensource.cirrus.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/soundwire/cadence_master.c