Commit de736dbb authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Greg Kroah-Hartman

staging: xgifb: fail the probe if no supported LCD video mode found

Fail the probe if the LCD resolution described in card firmware does
not match any of the supported modes.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 35c064da
...@@ -449,7 +449,7 @@ static int XGIfb_GetXG21DefaultLVDSModeIdx(void) ...@@ -449,7 +449,7 @@ static int XGIfb_GetXG21DefaultLVDSModeIdx(void)
XGIfb_mode_idx++; XGIfb_mode_idx++;
} }
if (!found_mode) if (!found_mode)
XGIfb_mode_idx = 0; XGIfb_mode_idx = -1;
return XGIfb_mode_idx; return XGIfb_mode_idx;
} }
...@@ -2313,6 +2313,11 @@ static int __devinit xgifb_probe(struct pci_dev *pdev, ...@@ -2313,6 +2313,11 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
} }
} }
if (xgifb_mode_idx < 0) {
dev_err(&pdev->dev, "no supported video mode found\n");
goto error_1;
}
if (xgi21_drvlcdcaplist) { if (xgi21_drvlcdcaplist) {
int m; int m;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment