* [bug report] drm/amdgpu: switch ih handling to two levels (v3)
@ 2017-04-04 13:04 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2017-04-04 13:04 UTC (permalink / raw)
To: alexander.deucher-5C7GfCeVMHo; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Hello Alex Deucher,
The patch d766e6a39338: "drm/amdgpu: switch ih handling to two levels
(v3)" from Mar 29, 2016, leads to the following static checker
warning:
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:319 amdgpu_irq_add_id()
warn: double check that we're allocating correct size: 8 vs 32
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
305 int amdgpu_irq_add_id(struct amdgpu_device *adev,
306 unsigned client_id, unsigned src_id,
307 struct amdgpu_irq_src *source)
308 {
309 if (client_id >= AMDGPU_IH_CLIENTID_MAX)
310 return -EINVAL;
311
312 if (src_id >= AMDGPU_MAX_IRQ_SRC_ID)
313 return -EINVAL;
314
315 if (!source->funcs)
316 return -EINVAL;
317
318 if (!adev->irq.client[client_id].sources) {
319 adev->irq.client[client_id].sources = kcalloc(AMDGPU_MAX_IRQ_SRC_ID,
320 sizeof(struct amdgpu_irq_src),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
We want to allocate an array of pointers, so probably this could be
changed to sizeof(void *)?
321 GFP_KERNEL);
322 if (!adev->irq.client[client_id].sources)
323 return -ENOMEM;
324 }
regards,
dan carpenter
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-04-04 13:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-04 13:04 [bug report] drm/amdgpu: switch ih handling to two levels (v3) Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox