From cc9f9ce47e7d9de63fa69e480d3cea605a9d1eca Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 28 Oct 2016 16:56:13 -0400 Subject: [PATCH] amdgpu: check parameters in amdgpu_query_gpu_info Make sure they aren't NULL. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97993 Signed-off-by: Alex Deucher --- amdgpu/amdgpu_gpu_info.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c index 0f23297..66c7e0e 100644 --- a/amdgpu/amdgpu_gpu_info.c +++ b/amdgpu/amdgpu_gpu_info.c @@ -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; -- 2.5.5