mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 08:34:20 +08:00
soundwire: stream: fix out of boundary access on port properties
Assigning local iterator to array element and using it again for indexing would cross the array boundary. Fix this by directly referring array element without using the local variable. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
a188339ca5
commit
03ecad90d3
@ -1406,9 +1406,7 @@ struct sdw_dpn_prop *sdw_get_slave_dpn_prop(struct sdw_slave *slave,
|
||||
}
|
||||
|
||||
for (i = 0; i < num_ports; i++) {
|
||||
dpn_prop = &dpn_prop[i];
|
||||
|
||||
if (dpn_prop->num == port_num)
|
||||
if (dpn_prop[i].num == port_num)
|
||||
return &dpn_prop[i];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user