Skip to content

Commit

Permalink
fbdev: savage: Handle err return when savagefb_check_var failed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Cai Xinchen authored and Helge Deller committed Apr 25, 2024
1 parent 5317797 commit 6ad959b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/video/fbdev/savage/savagefb_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2276,7 +2276,10 @@ static int savagefb_probe(struct pci_dev *dev, const struct pci_device_id *id)
if (info->var.xres_virtual > 0x1000)
info->var.xres_virtual = 0x1000;
#endif
savagefb_check_var(&info->var, info);
err = savagefb_check_var(&info->var, info);
if (err)
goto failed;

savagefb_set_fix(info);

/*
Expand Down

0 comments on commit 6ad959b

Please sign in to comment.