Applied. Thanks!
On Fri, Sep 5, 2025 at 8:49 AM Wang, Yang(Kevin) <[email protected]> wrote: > > [AMD Official Use Only - AMD Internal Distribution Only] > > Reviewed-by: Yang Wang <[email protected]> > > Best Regards, > Kevin > > -----Original Message----- > From: John Olender <[email protected]> > Sent: Friday, September 5, 2025 6:11 PM > To: Wang, Yang(Kevin) <[email protected]>; Lazar, Lijo > <[email protected]>; [email protected] > Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander > <[email protected]>; Sun, Ce(Overlord) <[email protected]>; John Olender > <[email protected]> > Subject: [PATCH] drm/amdgpu: Fix NULL ptr deref in > amdgpu_device_cache_switch_state() > > Kaveri has no upstream bridge, therefore parent is NULL. > > $ lspci -PP > ... > 00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] > Kaveri [Radeon R7 Graphics] (rev d4) > > For comparison, Raphael: > > $ lspci -PP > ... > 00:08.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Raphael/Granite Ridge > Internal GPP Bridge to Bus [C:A] ... > 00:08.1/0e:00.0 VGA compatible controller: Advanced Micro Devices, Inc. > [AMD/ATI] Raphael (rev c5) > > Fixes: e5e203e0cd53 ("drm/amdgpu: Save and restore switch state") > Link: > https://lore.kernel.org/amd-gfx/[email protected]/ > Signed-off-by: John Olender <[email protected]> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index 7783272a7930..ca58cde66446 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -7148,7 +7148,7 @@ static void amdgpu_device_cache_switch_state(struct > amdgpu_device *adev) > struct pci_dev *parent = pci_upstream_bridge(adev->pdev); > int r; > > - if (parent->vendor != PCI_VENDOR_ID_ATI) > + if (!parent || parent->vendor != PCI_VENDOR_ID_ATI) > return; > > /* If already saved, return */ > > base-commit: 035edba1e204b302ae74269d4f09e355153a79ac > -- > 2.47.2 >
