ALSA: oss: consolidate kmalloc/memset 0 call to kzalloc
authorNicholas Mc Guire <hofrat@osadl.org>
Sat, 19 Dec 2015 14:23:13 +0000 (15:23 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sun, 20 Dec 2015 21:31:02 +0000 (22:31 +0100)
This is an API consolidation only. The use of kmalloc + memset to 0
is equivalent to kzalloc.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/oss/pcm_oss.c

index e557dbe469f4691d05031c0c0a4b322d17f1db32..0e73d03b30e3f0d712b26f65453346e419caa96d 100644 (file)
@@ -851,7 +851,7 @@ static int snd_pcm_oss_change_params(struct snd_pcm_substream *substream)
 
        if (mutex_lock_interruptible(&runtime->oss.params_lock))
                return -EINTR;
-       sw_params = kmalloc(sizeof(*sw_params), GFP_KERNEL);
+       sw_params = kzalloc(sizeof(*sw_params), GFP_KERNEL);
        params = kmalloc(sizeof(*params), GFP_KERNEL);
        sparams = kmalloc(sizeof(*sparams), GFP_KERNEL);
        if (!sw_params || !params || !sparams) {
@@ -989,7 +989,6 @@ static int snd_pcm_oss_change_params(struct snd_pcm_substream *substream)
                goto failure;
        }
 
-       memset(sw_params, 0, sizeof(*sw_params));
        if (runtime->oss.trigger) {
                sw_params->start_threshold = 1;
        } else {