Skip to content
Commit 2b101256 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Takashi Iwai
Browse files

ALSA: usb-audio: scarlett2: Use struct_size() helper in scarlett2_usb()

Make use of the struct_size() helper instead of an open-coded version,
in order to avoid any potential type mistakes or integer overflows that,
in the worst scenario, could lead to heap overflows.

Also, address the following sparse warnings:
sound/usb/mixer_scarlett_gen2.c:1064:28: warning: using sizeof on a flexible structure
sound/usb/mixer_scarlett_gen2.c:1065:29: warning: using sizeof on a flexible structure

Link: https://github.com/KSPP/linux/issues/174


Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220120211600.GA28841@embeddedor


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent e783362e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment