linux-stable/drivers/video
Tom Rix ad6f93e9cd video: fbdev: sis: fix null ptr dereference
Clang static analysis reports this representative error

init.c:2501:18: warning: Array access (from variable 'queuedata') results
  in a null pointer dereference
      templ |= ((queuedata[i] & 0xc0) << 3);

This is the problem block of code

   if(ModeNo > 0x13) {
      ...
      if(SiS_Pr->ChipType == SIS_730) {
	 queuedata = &FQBQData730[0];
      } else {
	 queuedata = &FQBQData[0];
      }
   } else {

   }

queuedata is not set in the else block

Reviewing the old code, the arrays FQBQData730 and FQBQData were
used directly.

So hoist the setting of queuedata out of the if-else block.

Fixes: 544393fe58 ("[PATCH] sisfb update")
Signed-off-by: Tom Rix <trix@redhat.com>
Cc: Thomas Winischhofer <thomas@winischhofer.net>
Cc: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200805145208.17727-1-trix@redhat.com
2020-09-08 13:33:06 +02:00
..
backlight pwm: Changes for v5.9-rc1 2020-08-14 16:00:09 -07:00
console TTY/Serial patches for 5.9-rc1 2020-08-06 14:56:11 -07:00
fbdev video: fbdev: sis: fix null ptr dereference 2020-09-08 13:33:06 +02:00
logo
display_timing.c
hdmi.c
Kconfig
Makefile
of_display_timing.c
of_videomode.c
vgastate.c
videomode.c