All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: alexander.deucher-5C7GfCeVMHo@public.gmane.org
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [bug report] drm/amdgpu: switch ih handling to two levels (v3)
Date: Tue, 4 Apr 2017 16:04:13 +0300	[thread overview]
Message-ID: <20170404130413.GA6210@mwanda> (raw)

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

                 reply	other threads:[~2017-04-04 13:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170404130413.GA6210@mwanda \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=alexander.deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.