soundwire: qcom: fix device status array range
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Fri, 8 Jul 2022 10:47:47 +0000 (11:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Sep 2022 10:28:03 +0000 (12:28 +0200)
commit839ca7969fcfc975e3898d9148b77705315c9a07
treef69b2e1c895df3fa0cc5f1a872f76f9bf7d222f1
parentfdc69b070071eb644c94a5e5e72da7b10b975220
soundwire: qcom: fix device status array range

[ Upstream commit 4ef3f2aff1267bfa6d5a90c42a30b927b8aa239b ]

This patch updates device status array range from 11 to 12 as we will
be reading status from device number 0 to device number 11 inclusive.

Without this patch we can potentially access status array out of range
during auto-enumeration.

Fixes: aa1262ca6695 ("soundwire: qcom: Check device status before reading devid")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220708104747.8722-1-srinivas.kandagatla@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soundwire/qcom.c