From: Lloyd Atkinson Date: Tue, 16 Jan 2018 21:26:02 +0000 (-0500) Subject: drm/msm/dsi: correct DSI id bounds check during registration X-Git-Tag: v4.17-rc1~185^2~10^2~34 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=6e1787cf45e48866c01dadc2a1b6c3d63d75b8d1;p=linux.git drm/msm/dsi: correct DSI id bounds check during registration Check DSI instance id argument against the proper boundary size to protect against invalid configuration of the DSI id. Signed-off-by: Lloyd Atkinson Signed-off-by: Rob Clark --- diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 1a54fd67c9c4..4cb1cb68878b 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -862,7 +862,7 @@ int msm_dsi_manager_register(struct msm_dsi *msm_dsi) int id = msm_dsi->id; int ret; - if (id > DSI_MAX) { + if (id >= DSI_MAX) { pr_err("%s: invalid id %d\n", __func__, id); return -EINVAL; }