Skip to contentSkip to conversation

amdgpu: check parameters in amdgpu_query_gpu_info

PATCH In review Alex Deucher 2 participants 2 messages Oct 28, 2016 – Oct 30, 2016 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 amdgpu: check parameters in amdgpu_query_gpu_info

Make sure they aren't NULL.

---

This bug probably needs to be fixed in the OCL driver, but this patch fixes the acute problem and may be enough to fix the bug overall. Needs further investigation by the OCL team.

amdgpu/amdgpu_gpu_info.c | 2 ++

 1 file changed, 2 insertions(+)
amdgpu/amdgpu_gpu_info.c +2 -0
index 0f23297..66c7e0e 100644
@@ -230,6 +230,8 @@ drm_private int amdgpu_query_gpu_info_init(amdgpu_device_handle dev)
 int amdgpu_query_gpu_info(amdgpu_device_handle dev,
 			struct amdgpu_gpu_info *info)
 {
+	if ((dev == NULL) || (info == NULL))
+		return -EINVAL;
 	/* Get ASIC info*/
 	*info = dev->info;
 
Signature · 6 lines
2.5.5

_______________________________________________
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): 1477688506-26549-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw

Am 28.10.2016 um 23:01 schrieb Alex Deucher:

Quoted 5 lines

Make sure they aren't NULL.

Quoted 14 lines

---

This bug probably needs to be fixed in the OCL driver, but this patch fixes the acute problem and may be enough to fix the bug overall. Needs further investigation by the OCL team.

amdgpu/amdgpu_gpu_info.c | 2 ++

  1 file changed, 2 insertions(+)
amdgpu/amdgpu_gpu_info.c +0 -0
index 0f23297..66c7e0e 100644

amdgpu/amdgpu_gpu_info.c drm_private int amdgpu_query_gpu_info_init(amdgpu_device_handle dev) · line 237

Quoted 8 lines
amdgpu/amdgpu_gpu_info.c +2 -0
@@ -230,6 +230,8 @@ drm_private int amdgpu_query_gpu_info_init(amdgpu_device_handle dev)
  int amdgpu_query_gpu_info(amdgpu_device_handle dev,
  			struct amdgpu_gpu_info *info)
  {
+	if ((dev == NULL) || (info == NULL))
+		return -EINVAL;
  	/* Get ASIC info*/
  	*info = dev->info;
 

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