MLK-20208-2 mxc IPUv3: device: Avoid potential out of bounds array access
authorLiu Ying <victor.liu@nxp.com>
Tue, 26 Mar 2019 05:55:46 +0000 (13:55 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Thu, 2 May 2019 08:35:31 +0000 (11:35 +0300)
commit3104216de1a5e1fb37fe57753278e93d054d3f53
tree0ebc154432c23a2d68e5349ae7725f9f5333cf6e
parenta40f67dee04de4d13a138edb4475138aba53638a
MLK-20208-2 mxc IPUv3: device: Avoid potential out of bounds array access

To avoid potential out of bounds array access on tbl->used[][],
let's check the tsk->ipu_id prior to that.  Based on the context,
this is what we can do to make the coverity happy.

Detected by CoverityScan, CID#17689 ("Derefernece before null check")

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit f5dcf709c54da8e64eb84f1dd7a4452ad8d942cf)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>
(cherry picked from commit a9d03df1de0c6744335eb185506a3b6e27c4d24b)
drivers/mxc/ipu3/ipu_device.c