mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: kbuild test robot <fengguang.wu@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: dri-devel@lists.freedesktop.org, David Airlie <airlied@linux.ie>,
	intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	kbuild-all@01.org, Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/pmu: fix noderef.cocci warnings
Date: Fri, 12 Jan 2018 14:28:01 +0000	[thread overview]
Message-ID: <b37e3df1-9627-79a5-237c-acf505a0dd4a@linux.intel.com> (raw)
In-Reply-To: <20180112133116.GA14498@lkp-ib03>


On 12/01/2018 13:31, kbuild test robot wrote:
> From: Fengguang Wu <fengguang.wu@intel.com>
> 
> drivers/gpu/drm/i915/i915_pmu.c:795:34-40: ERROR: application of sizeof to pointer
> 
>   sizeof when applied to a pointer typed expression gives the size of
>   the pointer
> 
> Generated by: scripts/coccinelle/misc/noderef.cocci
> 
> Fixes: 109ec558370f ("drm/i915/pmu: Only enumerate available counters in sysfs")
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
> 
>   i915_pmu.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/drivers/gpu/drm/i915/i915_pmu.c
> +++ b/drivers/gpu/drm/i915/i915_pmu.c
> @@ -792,7 +792,7 @@ create_event_attributes(struct drm_i915_
>   		goto err_alloc;
>   
>   	/* Max one pointer of each attribute type plus a termination entry. */
> -	attr = kzalloc((count * 2 + 1) * sizeof(attr), GFP_KERNEL);
> +	attr = kzalloc((count * 2 + 1) * sizeof(*attr), GFP_KERNEL);
>   	if (!attr)
>   		goto err_alloc;
>   

Luckily it is the same size so no actual bug, but fix is still valid. 
Will merge it once it passes CI, thanks!

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko

  reply	other threads:[~2018-01-12 14:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201801122113.PamSF4io%fengguang.wu@intel.com>
2018-01-12 13:31 ` kbuild test robot
2018-01-12 14:28   ` Tvrtko Ursulin [this message]
2018-01-12 14:33   ` Ville Syrjälä

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=b37e3df1-9627-79a5-237c-acf505a0dd4a@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fengguang.wu@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=tvrtko.ursulin@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome