drm/fb-helper: Fix drm_fb_helper_hotplug_event() NULL ptr argument
authorNoralf Trønnes <noralf@tronnes.org>
Wed, 15 May 2019 13:29:25 +0000 (15:29 +0200)
committerNoralf Trønnes <noralf@tronnes.org>
Thu, 16 May 2019 10:01:46 +0000 (12:01 +0200)
commit0586576950d5dd34d70cca7adba85e5fb08664f7
treeed13dc0fc3a3e2c1d5008a82aea1beb1b313670b
parent86d804f41e5d9e6e1af01539d85137db91992094
drm/fb-helper: Fix drm_fb_helper_hotplug_event() NULL ptr argument

drm_fb_helper_hotplug_event() should tolerate the fb_helper argument being
NULL. Commit 03a9606e7fee ("drm/fb-helper: Avoid race with DRM userspace")
introduced a fb_helper dereference before the NULL check.
Fixup by moving the dereference after the NULL check.

Fixes: 03a9606e7fee ("drm/fb-helper: Avoid race with DRM userspace")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190515132925.48867-1-noralf@tronnes.org
drivers/gpu/drm/drm_fb_helper.c