video: fbdev: sis: fix potential NULL dereference in sisfb_post_sis300()

Do no access bios[] if it's NULL.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
Haowen Bai 2022-04-01 11:41:16 +08:00 committed by Helge Deller
parent b23e868d35
commit d1d608ce78

View file

@ -4463,7 +4463,7 @@ static void sisfb_post_sis300(struct pci_dev *pdev)
SiS_SetReg(SISCR, 0x37, 0x02);
SiS_SetReg(SISPART2, 0x00, 0x1c);
v4 = 0x00; v5 = 0x00; v6 = 0x10;
if(ivideo->SiS_Pr.UseROM) {
if (ivideo->SiS_Pr.UseROM && bios) {
v4 = bios[0xf5];
v5 = bios[0xf6];
v6 = bios[0xf7];