staging: xgifb: fix LVDS LCD resolution data setup
authorAaro Koskinen <aaro.koskinen@iki.fi>
Mon, 29 Aug 2011 20:14:24 +0000 (23:14 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Sep 2011 18:41:22 +0000 (11:41 -0700)
commit009adf2d4be9479004e41fd9b49a6136498f256b
treee6badbd2b8ce92313555e14c181f61f8a9339a82
parentd27c6bc9f4f4250b006b26ee4458b416676580b7
staging: xgifb: fix LVDS LCD resolution data setup

If the driver fails to get LVDS LCD data from the firmware, it falls
back to using driver's hardcoded values. However, this is done too
early in the probe. The selected video mode index is not yet known,
and also in some cases it could be defaulting to -1 resulting in a read
outside the array. Fix this by moving the array lookup after the video
mode validation.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/xgifb/XGI_main_26.c