ALSA: usb-audio: Use kmemdup_array instead of kmemdup for multiple allocation
authorShen Lichuan <shenlichuan@vivo.com>
Mon, 26 Aug 2024 04:34:54 +0000 (12:34 +0800)
committerTakashi Iwai <tiwai@suse.de>
Mon, 26 Aug 2024 08:32:12 +0000 (10:32 +0200)
commitf7b1633d6467a08ff78744cb519a92fb24ad9a0c
treeb46260299b340d2e0731d4e159ab216874cfa640
parentb29ba8f1f9429b775a8b901364a21291588c2a23
ALSA: usb-audio: Use kmemdup_array instead of kmemdup for multiple allocation

Let the kmemdup_array() take care about multiplication
and possible overflows.

Using kmemdup_array() is more appropriate and makes the code
easier to audit.

Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
Link: https://patch.msgid.link/20240826043454.3198-1-shenlichuan@vivo.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/quirks.c