Skip to contentSkip to conversation

drm/amdgpu: add checking to avoid null pointer without enabling powerplay

PATCH In review Huang Rui 1 participant 2 messages Nov 19, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Huang Rui

author
#0 lore raw

PATCH 1/1 drm/amdgpu: add checking to avoid null pointer without enabling powerplay

This patch adds the checking to avoid null pointer reference while powerplay is disbaled.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
index c96f670..b42163c 100644
@@ -1668,7 +1668,7 @@ static int amdgpu_device_fw_loading(struct amdgpu_device *adev)
 		}
 	}
 
-	if (adev->powerplay.pp_funcs->load_firmware) {
+	if (adev->powerplay.pp_funcs && adev->powerplay.pp_funcs->load_firmware) {
 		r = adev->powerplay.pp_funcs->load_firmware(adev->powerplay.pp_handle);
 		if (r) {
 			pr_err("firmware loading failed\n");
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1542613970-22877-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw
Quoted 8 lines

-----Original Message-----
From: Huang Rui [mailto:[email protected]]
Sent: Monday, November 19, 2018 3:53 PM
To: [email protected]
Cc: Huang, Ray <[email protected]>
Subject: [PATCH] drm/amdgpu: add checking to avoid null pointer without enabling powerplay

Quoted 5 lines

This patch adds the checking to avoid null pointer reference while powerplay is disbaled.

Sorry, please ignore this patch. The fix is already in staging.

Thanks,
Ray

Quoted 22 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -1
index c96f670..b42163c 100644
@@ -1668,7 +1668,7 @@ static int amdgpu_device_fw_loading(struct
 amdgpu_device *adev)
 		}
 	}
 
-	if (adev->powerplay.pp_funcs->load_firmware) {
+	if (adev->powerplay.pp_funcs &&
+adev->powerplay.pp_funcs->load_firmware) {
 		r = adev->powerplay.pp_funcs->load_firmware(adev-
Quoted 1 line

powerplay.pp_handle);

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -1
 		if (r) {
 			pr_err("firmware loading failed\n");
--
Quoted 1 line

2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx