Skip to content

Commit 9af152d

Browse files
Ivan Abramovpatjak
authored andcommitted
drm/gma500: Add NULL check for pci_gfx_root in mid_get_vbt_data()
Since pci_get_domain_bus_and_slot() can return NULL, add NULL check for pci_gfx_root in the mid_get_vbt_data(). This change is similar to the checks implemented in mid_get_fuse_settings() and mid_get_pci_revID(), which were introduced by commit 0cecdd8 ("gma500: Final enables for Oaktrail") as "additional minor bulletproofing". Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: f910b41 ("gma500: Add the glue to the various BIOS and firmware interfaces") Signed-off-by: Ivan Abramov <i.abramov@mt-integration.ru> Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250306112046.17144-1-i.abramov@mt-integration.ru
1 parent 80da96d commit 9af152d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/gpu/drm/gma500/mid_bios.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,11 @@ static void mid_get_vbt_data(struct drm_psb_private *dev_priv)
279279
0, PCI_DEVFN(2, 0));
280280
int ret = -1;
281281

282+
if (pci_gfx_root == NULL) {
283+
WARN_ON(1);
284+
return;
285+
}
286+
282287
/* Get the address of the platform config vbt */
283288
pci_read_config_dword(pci_gfx_root, 0xFC, &addr);
284289
pci_dev_put(pci_gfx_root);

0 commit comments

Comments
 (0)