public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915/pmu: fix noderef.cocci warnings
@ 2018-01-12 17:03 Tvrtko Ursulin
  2018-01-12 17:03 ` [PATCH 2/2] drm/i915/pmu: Use kcalloc instead of kzalloc Tvrtko Ursulin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Tvrtko Ursulin @ 2018-01-12 17:03 UTC (permalink / raw)
  To: Intel-gfx; +Cc: Fengguang Wu

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>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@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 95ab5e28f5be..9be4f5201e41 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.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-01-12 18:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-12 17:03 [PATCH 1/2] drm/i915/pmu: fix noderef.cocci warnings Tvrtko Ursulin
2018-01-12 17:03 ` [PATCH 2/2] drm/i915/pmu: Use kcalloc instead of kzalloc Tvrtko Ursulin
2018-01-12 17:14   ` Ville Syrjälä
2018-01-12 17:25 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915/pmu: fix noderef.cocci warnings Patchwork
2018-01-12 18:46 ` ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox