From 4c501230846b99ad78435637500471caa77a65c8 Mon Sep 17 00:00:00 2001 From: Fengguang Wu Date: Fri, 12 Jan 2018 17:03:39 +0000 Subject: [PATCH] drm/i915/pmu: fix noderef.cocci warnings 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 Reviewed-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20180112170340.5387-1-tvrtko.ursulin@linux.intel.com --- drivers/gpu/drm/i915/i915_pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index 95ab5e2..9be4f52 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -794,7 +794,7 @@ create_event_attributes(struct drm_i915_private *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; -- 2.7.4