瀏覽代碼

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>
Lloyd Atkinson 7 年之前
父節點
當前提交
6e1787cf45
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/gpu/drm/msm/dsi/dsi_manager.c

+ 1 - 1
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;
 	}