MLK-16575 gpu: imx: dpu: fetcheco: Correct dpu->fe_priv[] access in dpu_fe_init()
authorLiu Ying <victor.liu@nxp.com>
Thu, 12 Oct 2017 06:55:45 +0000 (14:55 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:38:46 +0000 (15:38 -0500)
commitb8cd3772588fd82015a27a67a8b08eb4a7367919
tree7f486cd7aef1aefab753eb40584ffcfd4b0a9e32
parent6b6fbb6d357218973ab02aa5b8b688dab945bdd8
MLK-16575 gpu: imx: dpu: fetcheco: Correct dpu->fe_priv[] access in dpu_fe_init()

The array size of dpu->fe_priv is only 4.  We need to access the correct
entry of the array by comparing the id passed in dpu_fe_init() with
the entries in the fe_ids array instead of using the id directly.
This may avoid out-of-boundary array access on dpu->fe_priv.

Fixes: 936b978c44f3 ("MLK-16075-11 gpu: imx: dpu: Add basic fetcheco units support")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
drivers/gpu/imx/dpu/dpu-fetcheco.c