From: Takashi Iwai Date: Mon, 22 Apr 2013 08:38:26 +0000 (+0200) Subject: ALSA: compress: Use kzalloc() for ioctls writing back data X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=47966e977952856f184c93c4ae5da11e151cb4a3;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ALSA: compress: Use kzalloc() for ioctls writing back data Like the previous patch by Dan, we should clear the data to be returned from certain compress ioctls, namely, snd_compr_get_codec_caps() and snd_compr_get_params(). This time, we can simply replace kmalloc() with kzalloc(). Signed-off-by: Takashi Iwai --- diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 664c69398b41..a0bc47f8dcf7 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -428,7 +428,7 @@ snd_compr_get_codec_caps(struct snd_compr_stream *stream, unsigned long arg) if (!stream->ops->get_codec_caps) return -ENXIO; - caps = kmalloc(sizeof(*caps), GFP_KERNEL); + caps = kzalloc(sizeof(*caps), GFP_KERNEL); if (!caps) return -ENOMEM; @@ -545,7 +545,7 @@ snd_compr_get_params(struct snd_compr_stream *stream, unsigned long arg) if (!stream->ops->get_params) return -EBADFD; - params = kmalloc(sizeof(*params), GFP_KERNEL); + params = kzalloc(sizeof(*params), GFP_KERNEL); if (!params) return -ENOMEM; retval = stream->ops->get_params(stream, params);