ALSA: seq: Avoid confusion of aligned read size
authorTakashi Iwai <tiwai@suse.de>
Mon, 5 Jun 2023 14:47:58 +0000 (16:47 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 5 Jun 2023 14:49:07 +0000 (16:49 +0200)
commit8c15a18331191b67bdce54d21af068baec044baf
tree5f7262819c804f352dd01d6bdeee40ef920b8de3
parent4f4e7112666b5aa1f179b4046299f85c09b46821
ALSA: seq: Avoid confusion of aligned read size

Currently the read event packet size in snd_seq_read() is defined by
client->midi_version value that is guaranteed to be zero if UMP isn't
enabled.  But the static analyzer doesn't know of the fact, and it
still suspects as if it were leading to a potential overflow.

Add the more explicit check of CONFIG_SND_SEQ_UMP to determine the
aligned_size value for avoiding the confusion.

Fixes: 46397622a3fa ("ALSA: seq: Add UMP support")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202305261415.NY0vapZK-lkp@intel.com/
Link: https://lore.kernel.org/r/20230605144758.6677-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/seq/seq_clientmgr.c