Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86435f39 authored by Cai Xinchen's avatar Cai Xinchen Committed by Greg Kroah-Hartman
Browse files

fbdev: savage: Handle err return when savagefb_check_var failed



commit 6ad959b6703e2c4c5d7af03b4cfd5ff608036339 upstream.

The commit 04e5eac8f3ab("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: 04e5eac8f3ab ("fbdev: savage: Error out if pixclock equals zero")
Signed-off-by: default avatarCai Xinchen <caixinchen1@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bec5fe17
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2273,7 +2273,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);

	/*