Skip to content

Commit

Permalink
drm/i915/pmu: fix noderef.cocci warnings
Browse files Browse the repository at this point in the history
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: 109ec55 ("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>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180112170340.5387-1-tvrtko.ursulin@linux.intel.com
  • Loading branch information
Fengguang Wu authored and Tvrtko Ursulin committed Jan 12, 2018
1 parent 4900727 commit 4c50123
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/i915_pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 4c50123

Please sign in to comment.