[Intel-gfx] [PATCH 4/5] drm/i915: Allocate the pipe_crc->entires with kcalloc()

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Tue Dec 9 11:28:31 PST 2014


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

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

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 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



More information about the Intel-gfx mailing list