staging: xgifb: validate the mode against video memory size
authorAaro Koskinen <aaro.koskinen@iki.fi>
Tue, 11 Sep 2012 21:44:37 +0000 (00:44 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Sep 2012 16:45:58 +0000 (09:45 -0700)
commita09f347c6cc0b2821557d1346c4733cc78a79ffa
tree3d5e09a361d5e3c4f00cee44b0a887f9dbd87821
parentf325129ae9006298cfbeffb669b30f57ba0cc3c4
staging: xgifb: validate the mode against video memory size

It's possible to select video mode that exceeds the available video
memory. This is potentially dangerous, fix by adding a check.

The patch fixes system hangs seen occasionally when playing random videos
with mplayer.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/xgifb/XGI_main_26.c