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 <latkinso@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
Lloyd Atkinson 2018-01-16 16:26:02 -05:00 committed by Rob Clark
parent f0efc831d9
commit 6e1787cf45
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}