]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: mixart: Reduce size of mixart_timer_notify
authorKees Cook <keescook@chromium.org>
Tue, 7 Dec 2021 06:29:41 +0000 (22:29 -0800)
committerTakashi Iwai <tiwai@suse.de>
Tue, 7 Dec 2021 07:58:38 +0000 (08:58 +0100)
commite6f7a92288eab923a1ab810c8022c57be19a297f
tree9915e3317124f201a7fc2de395ea25ed9b4af625
parenteab6065f7b3f3db9648d1dc7034f5e6c8b415af8
ALSA: mixart: Reduce size of mixart_timer_notify

The mixart_timer_notify structure was larger than could be represented
by the mixart_msg_data array storage. Adjust the size to as large as
possible to fix the warning seen with -Warray-bounds builds:

sound/pci/mixart/mixart_core.c: In function 'snd_mixart_threaded_irq':
sound/pci/mixart/mixart_core.c:447:50: error: array subscript 'struct mixart_timer_notify[0]' is partly outside array bounds of 'u32[128]' {aka 'unsigned int[128]'} [-Werror=array-bounds]
  447 |                                 for(i=0; i<notify->stream_count; i++) {
      |                                                  ^~
sound/pci/mixart/mixart_core.c:328:12: note: while referencing 'mixart_msg_data'
  328 | static u32 mixart_msg_data[MSG_DEFAULT_SIZE / 4];
      |            ^~~~~~~~~~~~~~~

Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20211207062941.2413679-1-keescook@chromium.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/mixart/mixart_core.c
sound/pci/mixart/mixart_core.h