]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/msm/dsi: correct DSI id bounds check during registration
authorLloyd Atkinson <latkinso@codeaurora.org>
Tue, 16 Jan 2018 21:26:02 +0000 (16:26 -0500)
committerRob Clark <robdclark@gmail.com>
Tue, 20 Feb 2018 15:41:20 +0000 (10:41 -0500)
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>
drivers/gpu/drm/msm/dsi/dsi_manager.c

index 1a54fd67c9c4186591d795121909a224248f90d4..4cb1cb68878b0dec65313d092aa8c28848e3f436 100644 (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;
        }