提交 d0918261 编写于 作者: S Srinivas Kandagatla 提交者: Xie XiuQi

soundwire: stream: fix out of boundary access on port properties

[ Upstream commit 03ecad90 ]

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: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: NPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: NVinod Koul <vkoul@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 81f2c5e4
...@@ -1236,9 +1236,7 @@ struct sdw_dpn_prop *sdw_get_slave_dpn_prop(struct sdw_slave *slave, ...@@ -1236,9 +1236,7 @@ struct sdw_dpn_prop *sdw_get_slave_dpn_prop(struct sdw_slave *slave,
} }
for (i = 0; i < num_ports; i++) { for (i = 0; i < num_ports; i++) {
dpn_prop = &dpn_prop[i]; if (dpn_prop[i].num == port_num)
if (dpn_prop->num == port_num)
return &dpn_prop[i]; return &dpn_prop[i];
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册