]> Git Repo - linux.git/commit - arch/x86/pci/fixup.c
x86/PCI: Check pcie_find_root_port() return for NULL
authorSamasth Norway Ananda <[email protected]>
Mon, 12 Aug 2024 20:26:59 +0000 (13:26 -0700)
committerBjorn Helgaas <[email protected]>
Wed, 21 Aug 2024 20:28:08 +0000 (15:28 -0500)
commitdbc3171194403d0d40e4bdeae666f6e76e428b53
tree8dae8ed665e16931acb906d28566700e527a0a57
parent8400291e289ee6b2bf9779ff1c83a291501f017b
x86/PCI: Check pcie_find_root_port() return for NULL

If pcie_find_root_port() is unable to locate a Root Port, it will return
NULL. Check the pointer for NULL before dereferencing it.

This particular case is in a quirk for devices that are always below a Root
Port, so this won't avoid a problem and doesn't need to be backported, but
check as a matter of style and to prevent copy/paste mistakes.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Samasth Norway Ananda <[email protected]>
[bhelgaas: drop Fixes: and explain why there's no problem in this case]
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Mario Limonciello <[email protected]>
arch/x86/pci/fixup.c
This page took 0.053695 seconds and 4 git commands to generate.