Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

GPU-DRM: Replace a kzalloc() call by kcalloc() in drm_legacy_addbufs_sg()

The script "checkpatch.pl" can point information out like the following.

WARNING: Prefer kcalloc over kzalloc with multiply

Thus fix the affected source code place.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/b340d1ca-f114-a523-e6d1-afe7fd6c3826@users.sourceforge.net

authored by

Markus Elfring and committed by
Daniel Vetter
b5a2ecd8 81a44137

+1 -2
+1 -2
drivers/gpu/drm/drm_bufs.c
··· 1117 1117 return -EINVAL; 1118 1118 } 1119 1119 1120 - entry->buflist = kzalloc(count * sizeof(*entry->buflist), 1121 - GFP_KERNEL); 1120 + entry->buflist = kcalloc(count, sizeof(*entry->buflist), GFP_KERNEL); 1122 1121 if (!entry->buflist) { 1123 1122 mutex_unlock(&dev->struct_mutex); 1124 1123 atomic_dec(&dev->buf_alloc);