MLK-18848: drm: imx: dcss: fix kernel oops
authorLaurentiu Palcu <laurentiu.palcu@nxp.com>
Thu, 19 Jul 2018 07:32:17 +0000 (10:32 +0300)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
commit4547091676ae088fe81fb475766b36090e0a3252
tree1b1249a9ec8dedcad8d49cba67ca6861f587446d
parentb085c6e81557393fb08d1337989d7c04ed1ff23e
MLK-18848: drm: imx: dcss: fix kernel oops

This patch fixes a NULL pointer dereference error that can happen
randomly, in certain conditions. The reason for the oops were assignments
that were done before checking that the actual pointer was valid...

Additionally, add a crtc check when duplicating the state.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
drivers/gpu/drm/imx/dcss/dcss-crtc.c
drivers/gpu/drm/imx/dcss/dcss-plane.c