]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit777c5113a35e95474027b01a0302d9dae12fbdab
tree4ec7fa428c5f6abf59a234167a035ff911678c9c
parentb2f8056cc7ce1aeef2b93abd9b44b73f459f26a6
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: b6b1ae4f84ee ("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