drm/msm: don't deref error pointer in the msm_fbdev_create error path
authorEmil Velikov <emil.velikov@collabora.com>
Wed, 28 Mar 2018 16:22:16 +0000 (17:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Jun 2018 19:02:44 +0000 (04:02 +0900)
commitb6126afd64d069384e41605779e8e27288185359
tree0fa511784828b6b7f69ac5b6bce9c76c9754fd6c
parent5151a0c8d730509cc92ac2d1a2697dd0fe48be59
drm/msm: don't deref error pointer in the msm_fbdev_create error path

[ Upstream commit 789d4c300e10eb2096ee83c3497118e67ccc951e ]

Currently the error pointer returned by msm_alloc_stolen_fb gets passed
to drm_framebuffer_remove. The latter handles only NULL pointers, thus
a nasty crash will occur.

Drop the unnecessary fail label and the associated checks - both err and
fb will be set at this stage.

Cc: Rob Clark <robdclark@gmail.com>
Cc: linux-arm-msm@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: freedreno@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/msm/msm_fbdev.c