Skip to contentSkip to conversation

drm/amdgpu: fix over allocating of IRQ sources

PATCH In review Christian König 2 participants 2 messages Apr 5, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fix over allocating of IRQ sources

From: Christian König <[email protected]>

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

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +4 -3
index 1309886..f8a6c95 100644
@@ -327,9 +327,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;
 	}
Signature · 6 lines
2.5.0

_______________________________________________
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): 1491385632-20127-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 6 lines · Christian König

From: Christian König <[email protected]>

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

Quoted 25 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +4 -4
index 1309886..f8a6c95 100644
@@ -327,9 +327,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;
        }
--

2.5.0

Quoted 4 lines

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

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