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)
committerRob Clark <robdclark@gmail.com>
Sun, 3 Jun 2018 20:49:00 +0000 (16:49 -0400)
commit641be142bfc241b3e1ce7ecf3f04ef03facfe81e
treec348a1cd61025ea6d62706b3e15df32939354474
parentcf606fe3300cbd3db44785174934e61e5a2ffc37
drm/msm: don't deref error pointer in the msm_fbdev_create error path

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>
drivers/gpu/drm/msm/msm_fbdev.c