]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
phy: qcom: qmp-usbc: Fix out-of-bounds array access in dp swing config
authorXiangxu Yin <xiangxu.yin@oss.qualcomm.com>
Fri, 27 Feb 2026 12:15:01 +0000 (20:15 +0800)
committerVinod Koul <vkoul@kernel.org>
Tue, 19 May 2026 10:12:11 +0000 (15:42 +0530)
commitea17fc4d7dc2ba6459b1a318962960520201baf1
treed72f22bfbc44176848322a9da8981d58f295d843
parent1854082fe0ddb81bc93d1f8e8a00554217fd09d1
phy: qcom: qmp-usbc: Fix out-of-bounds array access in dp swing config

swing_tbl and pre_emphasis_tbl are 4x4 arrays (valid indices 0-3), but
the boundary check uses "> 4" instead of ">= 4", allowing index 4 to
cause an out-of-bounds access.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Fixes: 81791c45c8e0 ("phy: qcom: qmp-usbc: Add QCS615 USB/DP PHY config and DP mode support")
Signed-off-by: Xiangxu Yin <xiangxu.yin@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20260227-master-v1-1-8d91b9407fdb@oss.qualcomm.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/qualcomm/phy-qcom-qmp-usbc.c