Răsfoiți Sursa

drm/amdgpu: fix over allocating of IRQ sources

We need an array of pointers to IRQ sources, not an array of sources.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Christian König 8 ani în urmă
părinte
comite
6e3f187cc0
1 a modificat fișierele cu 4 adăugiri și 3 ștergeri
  1. 4 3
      drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c

+ 4 - 3
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c

@@ -316,9 +316,10 @@ int amdgpu_irq_add_id(struct amdgpu_device *adev,
 		return -EINVAL;
 
 	if (!adev->irq.client[client_id].sources) {
-		adev->irq.client[client_id].sources = kcalloc(AMDGPU_MAX_IRQ_SRC_ID,
-							      sizeof(struct amdgpu_irq_src),
-							      GFP_KERNEL);
+		adev->irq.client[client_id].sources =
+			kcalloc(AMDGPU_MAX_IRQ_SRC_ID,
+				sizeof(struct amdgpu_irq_src *),
+				GFP_KERNEL);
 		if (!adev->irq.client[client_id].sources)
 			return -ENOMEM;
 	}