]> www.infradead.org Git - users/dwmw2/linux.git/commit
ALSA: ump: Copy safe string name to rawmidi
authorTakashi Iwai <tiwai@suse.de>
Fri, 10 Jan 2025 15:59:38 +0000 (16:59 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sun, 12 Jan 2025 12:12:20 +0000 (13:12 +0100)
commit85e8d66f30f967cda91b3ee6dfcb0a0c2391e612
treee444f9fbd0c6c96d55eddeb919a13341211c97b2
parente3f035edadcc1c5901311c03d098bc3dedc5c525
ALSA: ump: Copy safe string name to rawmidi

The UMP helper didn't set up the rawmidi name string by itself but
left it to the driver.  But since the only user (USB MIDI2 driver)
picks up the UMP info name string to the rawmidi name as default, it's
better to set up in the UMP core side.

Meanwhile, UMP receives the EP name string from the device, and it
might contain garbage letters.  We should purify the string to be
usable for the kernel as done previously for UMP Group names.

This implements the copy of the UMP info name string into the rawmidi
name at the creation of UMP EP object in a safe way to strip the
non-ASCII or non-printable characters.  Also, change the reference
from the legacy rawmidi and other places to rawmidi name field instead
of ump info; this assures the sane strings.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250110155943.31578-6-tiwai@suse.de
sound/core/ump.c