Skip to content

Commit 6ad959b

Browse files
Caixinchen1hdeller
authored andcommitted
fbdev: savage: Handle err return when savagefb_check_var failed
The commit 04e5eac("fbdev: savage: Error out if pixclock equals zero") checks the value of pixclock to avoid divide-by-zero error. However the function savagefb_probe doesn't handle the error return of savagefb_check_var. When pixclock is 0, it will cause divide-by-zero error. Fixes: 04e5eac ("fbdev: savage: Error out if pixclock equals zero") Signed-off-by: Cai Xinchen <caixinchen1@huawei.com> Cc: stable@vger.kernel.org Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 5317797 commit 6ad959b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/video/fbdev/savage/savagefb_driver.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2276,7 +2276,10 @@ static int savagefb_probe(struct pci_dev *dev, const struct pci_device_id *id)
22762276
if (info->var.xres_virtual > 0x1000)
22772277
info->var.xres_virtual = 0x1000;
22782278
#endif
2279-
savagefb_check_var(&info->var, info);
2279+
err = savagefb_check_var(&info->var, info);
2280+
if (err)
2281+
goto failed;
2282+
22802283
savagefb_set_fix(info);
22812284

22822285
/*

0 commit comments

Comments
 (0)