drm/gma500: Fix potential NULL pointer dereference
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Mon, 25 Jun 2018 12:18:44 +0000 (07:18 -0500)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 26 Jun 2018 13:23:46 +0000 (16:23 +0300)
commit80c18ba11a7a84cb97e39e5c9b6cdeee9f3c0728
tree4d4831d233247f6b92abfad87d333ba8b473558a
parenta63d3bd230772b307c6595469e615d44a1dacdab
drm/gma500: Fix potential NULL pointer dereference

fb is being dereferenced before it is null checked, hence there
is a potential null pointer dereference.

Fix this by moving the pointer dereference after fb has been
properly null checked at line 74: if (!fb)

Addresses-Coverity-ID: 1470169 ("Dereference before null check")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180625121844.GA12466@embeddedor.com
drivers/gpu/drm/gma500/gma_display.c