[media] VPU: mediatek: fix null pointer dereference on pdev
authorColin Ian King <colin.king@canonical.com>
Wed, 7 Sep 2016 17:10:27 +0000 (14:10 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 21 Oct 2016 14:09:34 +0000 (12:09 -0200)
commit211eba9e791e6f6f4c5945b7fabc1dba150075e4
treefd5b20ed9a05cc28325773f428dc092606e479e4
parent67712beb2df027ff36ff6d19b1aeb1af213fac04
[media] VPU: mediatek: fix null pointer dereference on pdev

pdev is being null checked, however, prior to that it is being
dereferenced by platform_get_drvdata.  Move the assignments of
vpu and run to after the pdev null check to avoid a potential
null pointer dereference.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/mtk-vpu/mtk_vpu.c