ALSA: firewire-motu: fix null pointer dereference when polling hwdep character device
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Wed, 27 Oct 2021 12:55:27 +0000 (21:55 +0900)
committerTakashi Iwai <tiwai@suse.de>
Thu, 28 Oct 2021 07:10:33 +0000 (09:10 +0200)
commitd593f78e3b53891692162d7b4e68f341c5869295
tree4ec7fa428c5f6abf59a234167a035ff911678c9c
parent375f8426ed994addd2be4d76febc946a6fdd8280
ALSA: firewire-motu: fix null pointer dereference when polling hwdep character device

ALSA firewire-motu driver recently got support for event notification via
ALSA HwDep interface for register DSP models. However, when polling ALSA
HwDep cdev, the driver can cause null pointer dereference for the other
models due to accessing to unallocated memory or uninitialized memory.

This commit fixes the bug by check the type of model before accessing to
the memory.

Reported-by: kernel test robot <lkp@intel.com>
Suggested-by: Takashi Iwai <tiwai@suse.de>
Fixes: 634ec0b2906e ("ALSA: firewire-motu: notify event for parameter change in register DSP model")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20211027125529.54295-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/motu/motu-hwdep.c