From: Ville Syrjälä <[email protected]>

pipe_crc->entries[] is an array so allocate with kcalloc() instead of
kzalloc().

Signed-off-by: Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c
index 3887e4f..d9d5f1f 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -3413,8 +3413,8 @@ static int pipe_crc_set_source(struct drm_device *dev, 
enum pipe pipe,
                DRM_DEBUG_DRIVER("collecting CRCs for pipe %c, %s\n",
                                 pipe_name(pipe), pipe_crc_source_name(source));
 
-               entries = kzalloc(sizeof(*pipe_crc->entries) *
-                                 INTEL_PIPE_CRC_ENTRIES_NR,
+               entries = kcalloc(INTEL_PIPE_CRC_ENTRIES_NR,
+                                 sizeof(pipe_crc->entries[0]),
                                  GFP_KERNEL);
                if (!entries)
                        return -ENOMEM;
-- 
2.0.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to