drm/rockchip: psr: do not dereference encoder before it is null checked.
commit5f0ab980de1a444dbd17dfdb02be9fc636f0cc14
authorEnric Balletbo i Serra <enric.balletbo@collabora.com>
Sat, 13 Oct 2018 10:56:54 +0000 (13 12:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Jan 2019 08:51:11 +0000 (13 09:51 +0100)
tree0b4ad0d8b819333f473d8fd49343033f8c3036f8
parent05a0177d84d9d76a246d8ee0fe176262bab9f293
drm/rockchip: psr: do not dereference encoder before it is null checked.

commit 4eda776c3cefcb1f01b2d85bd8753f67606282b5 upstream.

'encoder' is dereferenced before it is null sanity checked, hence we
potentially have a null pointer dereference bug. Instead, initialise
drm_drv from encoder->dev->dev_private after we are sure 'encoder' is
not null.

Fixes: 5182c1a556d7f ("drm/rockchip: add an common abstracted PSR driver")
Cc: stable@vger.kernel.org
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20181013105654.11827-1-enric.balletbo@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/rockchip/rockchip_drm_psr.c