ASoC: core: fix possible ZERO_SIZE_PTR pointer dereferencing error.
Xiubo Li authored
commit 6596aa04

 upstream.

Since we cannot make sure the 'params->num_regs' will always be none
zero here, and then if it equals to zero, the kmemdup() will return
ZERO_SIZE_PTR, which equals to ((void *)16).

So this patch fix this with just doing the zero check before calling
kmemdup().
Signed-off-by: default avatarXiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
8f805204
Name Last commit Last update
..
aoa ALSA: sound/aoa/codecs/onyx.c: use static const for texts
arm ASoC: pxa: remove mach header dependency
atmel ALSA: sound/atmel/ac97c.c: Convert to module_platform_driver
core ALSA: pcm: fix fifo_size frame calculation
drivers ALSA: drivers: Convert to snd_card_new() with a device pointer
firewire ALSA: firewire-lib/dice: add arrangements of PCM pointer and interrupts for Dice quirk
i2c ALSA: cs8427: separate HW initialization
isa ALSA: gus: remove checks for CONFIG_SND_DEBUG_ROM
mips ALSA: au1x00: Use resource_size instead of computation
oss sound: remove checks for CONFIG_BCM_CS4297A_CSWARM
parisc ALSA: parisc: Convert to snd_card_new() with a device pointer
pci ALSA: hda - Add fixup model name lookup for Lemote A1205
pcmcia ALSA: pcmcia: Convert to snd_card_new() with a device pointer
ppc ALSA: ppc: Convert to snd_card_new() with a device pointer
sh ALSA: sh: Convert to snd_card_new() with a device pointer
soc ASoC: core: fix possible ZERO_SIZE_PTR pointer dereferencing error.
sparc ALSA: sparc: Convert to snd_card_new() with a device pointer
spi ALSA: spi: Convert to snd_card_new() with a device pointer
synth ALSA: synth: emux: soundfont.c: Cleaning up memory leak
usb ALSA: usb-audio: fix BOSS ME-25 MIDI regression
Kconfig sound: remove reference to feature-removal-schedule.txt
Makefile ALSA: add LaCie FireWire Speakers/Griffin FireWave Surround driver
ac97_bus.c sound: Fixed line limit issue in sound/ac97_bus.c
last.c ALSA: Remove the last mention of SNDRV_MAIN_OBJECT_FILE
sound_core.c consolidate the reassignments of ->f_op in ->open() instances
sound_firmware.c sound_firmware: don't bother with filp_close()