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 <tiwai@suse.de>
This commit is contained in:
parent
1c62e9f2b5
commit
47966e9779
1 changed files with 2 additions and 2 deletions
|
@ -428,7 +428,7 @@ snd_compr_get_codec_caps(struct snd_compr_stream *stream, unsigned long arg)
|
||||||
if (!stream->ops->get_codec_caps)
|
if (!stream->ops->get_codec_caps)
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
|
|
||||||
caps = kmalloc(sizeof(*caps), GFP_KERNEL);
|
caps = kzalloc(sizeof(*caps), GFP_KERNEL);
|
||||||
if (!caps)
|
if (!caps)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
@ -545,7 +545,7 @@ snd_compr_get_params(struct snd_compr_stream *stream, unsigned long arg)
|
||||||
if (!stream->ops->get_params)
|
if (!stream->ops->get_params)
|
||||||
return -EBADFD;
|
return -EBADFD;
|
||||||
|
|
||||||
params = kmalloc(sizeof(*params), GFP_KERNEL);
|
params = kzalloc(sizeof(*params), GFP_KERNEL);
|
||||||
if (!params)
|
if (!params)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
retval = stream->ops->get_params(stream, params);
|
retval = stream->ops->get_params(stream, params);
|
||||||
|
|
Loading…
Add table
Reference in a new issue