]> git.baikalelectronics.ru Git - kernel.git/commit
video: fbdev: sm501fb: fix potential null pointer dereference on fbi
authorColin Ian King <colin.king@canonical.com>
Fri, 17 Nov 2017 16:21:48 +0000 (17:21 +0100)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Fri, 17 Nov 2017 16:21:48 +0000 (17:21 +0100)
commitd98babd455bfa35fabcc500d86e5f39a4e909e09
tree1228e9336961695239c00e577e6492afad26b353
parentec81f9393a25f6e70347573e5ce2b452d9eb4f17
video: fbdev: sm501fb: fix potential null pointer dereference on fbi

The pointer fbi is dereferenced with par = fbi->par before there is a
null check on fbi, hence there is a potential null pointer dereference
on a null par.  Fix this by moving the dereference after the null
pointer check.

Detected by CoverityScan, CID#1461301 ("Dereference before null check")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/sm501fb.c