drm/amdgpu: fix over allocating of IRQ sources
authorChristian König <christian.koenig@amd.com>
Wed, 5 Apr 2017 09:46:12 +0000 (11:46 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 6 Apr 2017 17:27:20 +0000 (13:27 -0400)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c

index 13b487235a8b8fca7198d6374b15474fd24880ac..a6b7e367a8607694da3965ac664d2081c7f97dde 100644 (file)
@@ -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;
        }