aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb (follow)
AgeCommit message (Collapse)AuthorFilesLines
2025-10-27ALSA: usb-audio: don't log messages meant for 1810c when initializing 1824cRoy Vegard Ovesen1-15/+18
The log messages for the PreSonus STUDIO 1810c about device_setup are not applicable to the 1824c, and should not be logged when 1824c initializes. Refactor from if statement to switch statement as there might be more STUDIO series devices added later. Fixes: 080564558eb1 ("ALSA: usb-audio: enable support for Presonus Studio 1824c within 1810c file") Signed-off-by: Roy Vegard Ovesen <roy.vegard.ovesen@gmail.com> Link: https://patch.msgid.link/aPaYTP7ceuABf8c7@ark Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-10-18ALSA: usb-audio: fix control pipe directionRoy Vegard Ovesen1-1/+1
Since the requesttype has USB_DIR_OUT the pipe should be constructed with usb_sndctrlpipe(). Fixes: 8dc5efe3d17c ("ALSA: usb-audio: Add support for Presonus Studio 1810c") Signed-off-by: Roy Vegard Ovesen <roy.vegard.ovesen@gmail.com> Link: https://patch.msgid.link/aPPL3tBFE_oU-JHv@ark Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-10-16ALSA: usb-audio: fix vendor quirk for Logitech H390Pauli Virtanen1-0/+1
Vendor quirk QUIRK_FLAG_CTL_MSG_DELAY_1M was inadvertently missing when adding quirk for Logitech H390. Add it back. Fixes: 2b929b6eec0c ("ALSA: usb-audio: add mixer_playback_min_mute quirk for Logitech H390") Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-10-16ALSA: usb-audio: add volume quirks for MS LifeChat LX-3000Pauli Virtanen2-0/+10
ID 045e:070f Microsoft Corp. LifeChat LX-3000 Headset has muted minimum Speaker Playback Volume, and 4 amixer steps were observed to produce 1 actual volume step. Apply min_mute quirk and correct res=48 -> 4*48. Tested with the device. Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-10-15ALSA: usb-audio: Fix NULL pointer deference in try_to_register_cardJiaming Zhang1-2/+8
In try_to_register_card(), the return value of usb_ifnum_to_if() is passed directly to usb_interface_claimed() without a NULL check, which will lead to a NULL pointer dereference when creating an invalid USB audio device. Fix this by adding a check to ensure the interface pointer is valid before passing it to usb_interface_claimed(). Fixes: 39efc9c8a973 ("ALSA: usb-audio: Fix last interface check for registration") Closes: https://lore.kernel.org/all/CANypQFYtQxHL5ghREs-BujZG413RPJGnO5TH=xjFBKpPts33tA@mail.gmail.com/ Signed-off-by: Jiaming Zhang <r772577952@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-10-13ALSA: usb-audio: add mixer_playback_min_mute quirk for Logitech H390Pauli Virtanen1-0/+2
ID 046d:0a8f Logitech, Inc. H390 headset with microphone is reported to have muted min playback volume. Apply quirk for that. Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4929 Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-10-11ALSA: usb-audio: apply quirk for Huawei Technologies Co., Ltd. CM-Q3Cryolitia PukNgae1-0/+7
There're several different actual hardwares sold by Huawei, using the same USB ID 12d1:3a07. The first one we found, having a volume control named "Headset Playback Volume", reports a min value -15360, and will mute iff setting it to -15360. It can be simply fixed by quirk flag MIXER_PLAYBACK_MIN_MUTE, which we have already submitted previously.[1] The second one we found today, having a volume control named "PCM Playback Volume", reports its min -11520 and res 256, and will mute when less than -11008. Because of the already existing quirk flag, we can just set its min to -11264, and the new minimum value will still not be available to userspace, so that userspace's minimum will be the correct -11008. 1. https://lore.kernel.org/all/20250903-sound-v1-3-d4ca777b8512@uniontech.com/ Tested-by: Guoli An <anguoli@uniontech.com> Signed-off-by: Cryolitia PukNgae <cryolitia.pukngae@linux.dev> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-10-07ALSA: usb: fpc: replace kmalloc_array followed by copy_from_user with ↵Pedro Demarchi Gomes1-6/+3
memdup_array_user Replace kmalloc_array() followed by copy_from_user() with memdup_array_user() to improve and simplify fcp_ioctl_set_meter_map(). No functional changes intended. Signed-off-by: Pedro Demarchi Gomes <pedrodemargomes@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-09-28ALSA: usb-audio: don't hardcode gain for output channel of Presonus StudioRoy Vegard Ovesen1-6/+1
On the 1824c output channel 4 left/right is the S/PDIF output, so this needs to be able to be set. I'm guessing that for the 1810c since it has no output channel 4, it does not matter what the gain value of this channel is set to. Signed-off-by: Roy Vegard Ovesen <roy.vegard.ovesen@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-09-28ALSA: usb-audio: add the initial mix for Presonus Studio 1824cRoy Vegard Ovesen1-89/+138
A reasonable initial mix for the 1824c is the one that Presonus Universal Control calls bypass. It mutes all the physical inputs, and connects Daw channel 1 to Line out channel 1 (left) Daw channel 2 to Line out channel 2 (right) Daw channel 3 to Line out channel 3 (left) etc. To get the most out of the 1824c a mixer application like Universal Control is needed. One is available for linux Link: https://github.com/royvegard/baton Signed-off-by: Roy Vegard Ovesen <roy.vegard.ovesen@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-09-28ALSA: usb-audio: make param quirk_flags change-able in runtimeCryolitia PukNgae1-2/+23
Change its permision from 0644 to 0444, and add runtime processing. Developers now can change it during sysfs, without rebooting, for debugging new buggy devices. Co-developed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-09-28ALSA: usb-audio: improve module param quirk_flagsCryolitia PukNgae3-8/+118
It accepts strings like `VID:PID:quirk_flag_name1|quirk_flag_name2;...` from now on, so that we can use it to debug USB audio devices more intuitive and flexible. The compatibility of previous form is kept. Co-developed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-09-28ALSA: usb-audio: add two-way convert between name and bit for QUIRK_FLAG_*Cryolitia PukNgae3-30/+144
Define quirk flags enum and its name. Add helper for converting between quirk flags' name and bit. - snd_usb_quirk_flag_find_name() - snd_usb_quirk_flags_from_name() Add helper for printing debug: log snd_usb_apply_flag_dbg() Co-developed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-09-28Merge branch 'for-linus' into for-nextTakashi Iwai4-55/+75
Pull 6.17-devel branch for applying further changes cleanly. Signed-off-by: Taksahi Iwai <tiwai@suse.de>
2025-09-28ALSA: usb-audio: fix race condition to UAF in snd_usbmidi_freeJeongjun Park1-5/+4
The previous commit 0718a78f6a9f ("ALSA: usb-audio: Kill timer properly at removal") patched a UAF issue caused by the error timer. However, because the error timer kill added in this patch occurs after the endpoint delete, a race condition to UAF still occurs, albeit rarely. Additionally, since kill-cleanup for urb is also missing, freed memory can be accessed in interrupt context related to urb, which can cause UAF. Therefore, to prevent this, error timer and urb must be killed before freeing the heap memory. Cc: <stable@vger.kernel.org> Reported-by: syzbot+f02665daa2abeef4a947@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=f02665daa2abeef4a947 Fixes: 0718a78f6a9f ("ALSA: usb-audio: Kill timer properly at removal") Signed-off-by: Jeongjun Park <aha310510@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-09-28ALSA: usb-audio: add mono main switch to Presonus S1824cRoy Vegard Ovesen1-3/+23
The 1824c does not have the A/B switch that the 1810c has, but instead it has a mono main switch that sums the two main output channels to mono. Signed-off-by: Roy Vegard Ovesen <roy.vegard.ovesen@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-09-23ALSA: usb-audio: don't apply interface quirk to Presonus S1824cRoy Vegard Ovesen1-3/+0
Testing with a Presonus STUDIO 1824c together with a Behringer ultragain digital ADAT device shows that using all 3 altno settings works fine. When selecting sample rate, the driver sets the interface to the correct altno setting and the correct number of channels is set. Selecting the correct altno setting via Ardour, Reaper or whatever other way to set the sample rate is more convenient than re-loading the driver module with device_setup to set altno. Signed-off-by: Roy Vegard Ovesen <roy.vegard.ovesen@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-09-20Merge tag 'asoc-v6.18' of ↵Takashi Iwai1-4/+8
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v6.18 A relatively quiet release for ASoC, we've had a lot of maintainance work going on and several new drivers but really the most remarkable thing is that we removed a driver, the WL1273 driver used in some old Nokia systems that have had the underlying system support removed from the kernel. - Morimoto-san continues his work on cleanups of the core APIs and enforcement of abstraction layers. - Lots of cleanups and conversions of DT bindings. - Substantial maintainance work on the Intel AVS drivers. - Support for Qualcomm Glymur and PM4125, Realtek RT1321, Shanghai FourSemi FS2104/5S, Texas Instruments PCM1754. - Remove support for TI WL1273.
2025-09-17ALSA: usb: qcom: Fix false-positive address space checkTakashi Iwai1-44/+48
The sanity check previously added to uaudio_transfer_buffer_setup() assumed the allocated buffer being linear-mapped. But the buffer allocated via usb_alloc_coherent() isn't always so, rather to be used with (SG-)DMA API. This leaded to a false-positive warning and the driver failed to work. Actually uaudio_transfer_buffer_setup() deals only with the DMA-API addresses for MEM_XFER_BUF type, while other callers of uaudio_iommu_map() are with pages with physical addresses for MEM_EVENT_RING and MEM_XFER_RING types. So this patch splits the mapping helper function to two different ones, uaudio_iommu_map() for the DMA pages and uaudio_iommu_map_pa() for the latter, in order to handle mapping differently for each type. Along with it, the unnecessary address check that caused probe error is dropped, too. Fixes: 3335a1bbd624 ("ALSA: qc_audio_offload: try to reduce address space confusion") Suggested-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Arnd Bergmann <arnd@arndb.de> Reported-and-tested-by: Luca Weiss <luca.weiss@fairphone.com> Closes: https://lore.kernel.org/DBR2363A95M1.L9XBNC003490@fairphone.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-09-10ALSA: usb-audio: Use guard() for spin locksTakashi Iwai1-103/+95
Clean up the code using guard() for spin locks. Merely code refactoring, and no behavior change. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-09-10ALSA: usb: fcp: Use guard() for spin locksTakashi Iwai1-10/+7
Clean up the code using guard() for spin locks. Merely code refactoring, and no behavior change. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-09-10ALSA: line6: Use guard() for spin locksTakashi Iwai4-44/+30
Clean up the code using guard() for spin locks. Merely code refactoring, and no behavior change. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-09-06ALSA: scarlett2: Add Vocaster speaker/headphone mute controlsGeoffrey D. Bennett1-1/+96
Add support for the speaker and headphone mute controls on Focusrite Vocaster interfaces. Unlike other Focusrite interfaces, these mute controls are per-output, not per-channel. Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Link: https://patch.msgid.link/aLm2Dy6+O/eLTGVn@m.b4.vu Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-09-04ALSA: usb-audio: apply quirk for MOONDROP Quark2Cryolitia PukNgae1-0/+7
It reports a MIN value -15360 for volume control, but will mute when setting it less than -14208 Tested-by: Guoli An <anguoli@uniontech.com> Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250903-sound-v1-4-d4ca777b8512@uniontech.com
2025-09-04ALSA: usb-audio: apply "mixer_min_mute" quirks on some devicesCryolitia PukNgae1-3/+7
- QUIRK_FLAG_MIXER_CAPTURE_MIN_MUTE - QUIRK_FLAG_MIXER_PLAYBACK_MIN_MUTE Suggested-by: Guoli An <anguoli@uniontech.com> Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250903-sound-v1-3-d4ca777b8512@uniontech.com
2025-09-04ALSA: usb-audio: add quirk QUIRK_FLAG_MIXER_CAPTURE_MIN_MUTECryolitia PukNgae2-0/+10
The same hardware problem to QUIRK_FLAG_MIXER_PLAYBACK_MIN_MUTE also occurs on the capture streams on some USB devices. Add a new flag for processing the quirk. Link: https://lore.kernel.org/all/C22C1A172EBB9BD9+eccc2e4a-d21e-4a7d-848c-bbf3982feb94@uniontech.com/ Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250903-sound-v1-2-d4ca777b8512@uniontech.com
2025-09-04ALSA: usb-audio: rename QUIRK_FLAG_MIXER_MIN_MUTE to ↵Cryolitia PukNgae3-14/+17
QUIRK_FLAG_MIXER_PLAYBACK_MIN_MUTE As a preparation of introduction QUIRK_FLAG_MIXER_CAPTURE_MIN_MUTE Also make it printing an info while applying Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250903-sound-v1-1-d4ca777b8512@uniontech.com
2025-09-01ALSA: caiaq: Use guard() for spin locksTakashi Iwai1-26/+13
Clean up the code using guard() for spin locks. Merely code refactoring, and no behavior change. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250829150724.6886-10-tiwai@suse.de
2025-09-01ALSA: bcd2000: Use guard() for mutex locksTakashi Iwai1-12/+4
Replace the manual mutex lock/unlock pairs with guard() for code simplification. Only code refactoring, and no behavior change. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250829150724.6886-9-tiwai@suse.de
2025-09-01ALSA: usb: qcom: Use guard() for mutex locksTakashi Iwai1-47/+22
Replace the manual mutex lock/unlock pairs with guard() for code simplification. The manual mutex lock/unlock are still left in handle_uaudio_stream_req() and its callee as they have a bit complex locking patterns. Only code refactoring, and no behavior change. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250829150724.6886-8-tiwai@suse.de
2025-09-01ALSA: line6: Use guard() for mutex locksTakashi Iwai2-35/+31
Replace the manual mutex lock/unlock pairs with guard() for code simplification. The core code of line6_pcm_release() is factored out, so that it can be covered by guard() nicely, too. Only code refactoring, and no behavior change. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250829150724.6886-7-tiwai@suse.de
2025-09-01ALSA: hiface: Use guard() for spin locksTakashi Iwai1-21/+14
Clean up the code using guard() for spin locks. Merely code refactoring, and no behavior change. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250829150724.6886-6-tiwai@suse.de
2025-09-01ALSA: hiface: Use guard() for mutex locksTakashi Iwai2-26/+10
Replace the manual mutex lock/unlock pairs with guard() for code simplification. Only code refactoring, and no behavior change. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250829150724.6886-5-tiwai@suse.de
2025-09-01ALSA: usx2y: Use guard() for mutex locksTakashi Iwai3-65/+35
Replace the manual mutex lock/unlock pairs with guard() for code simplification. Only code refactoring, and no behavior change. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250829150724.6886-4-tiwai@suse.de
2025-09-01ALSA: ua101: Use guard() for spin locksTakashi Iwai1-91/+80
Clean up the code using guard() for spin locks. Merely code refactoring, and no behavior change. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250829150724.6886-3-tiwai@suse.de
2025-09-01ALSA: ua101: Use guard() for mutex locksTakashi Iwai1-51/+34
Replace the manual mutex lock/unlock pairs with guard() for code simplification. Only code refactoring, and no behavior change. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250829150724.6886-2-tiwai@suse.de
2025-09-01ALSA: usb-audio: Allow Focusrite devices to use low sampleratesTina Wuest1-4/+8
Commit 05f254a6369ac020fc0382a7cbd3ef64ad997c92 ("ALSA: usb-audio: Improve filtering of sample rates on Focusrite devices") changed the check for max_rate in a way which was overly restrictive, forcing devices to use very high samplerates if they support them, despite support existing for lower rates as well. This maintains the intended outcome (ensuring samplerates selected are supported) while allowing devices with higher maximum samplerates to be opened at all supported samplerates. This patch was tested with a Clarett+ 8Pre USB Fixes: 05f254a6369a ("ALSA: usb-audio: Improve filtering of sample rates on Focusrite devices") Signed-off-by: Tina Wuest <tina@wuest.me> Link: https://patch.msgid.link/20250901092024.140993-1-tina@wuest.me Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-08-30Merge branch 'for-linus' into for-nextTakashi Iwai3-7/+27
Pull 6.17 devel branch for further auto-cleanup updates. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-08-29ALSA: usb-audio: Add mute TLV for playback volumes on more devicesqaqland1-0/+10
Applying the quirk of that, the lowest Playback mixer volume setting mutes the audio output, on more devices. Suggested-by: Cryolitia PukNgae <cryolitia@uniontech.com> Signed-off-by: qaqland <anguoli@uniontech.com> Link: https://patch.msgid.link/20250829-sound_quirk-v1-1-745529b44440@uniontech.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-08-27ALSA: usb-audio: move mixer_quirks' min_mute into common quirkCryolitia PukNgae3-9/+17
We have found more and more devices that have the same problem, that the mixer's minimum value is muted. Accroding to pipewire's MR[1] and Arch Linux wiki[2], this should be a very common problem in USB audio devices. Move the quirk into common quirk,as a preparation of more devices' quirk's patch coming on the road[3]. 1. https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/2514 2. https://wiki.archlinux.org/index.php?title=PipeWire&oldid=804138#No_sound_from_USB_DAC_until_30%_volume 3. On the road, in the physical sense. We have been buying ton of these devices for testing the problem. Tested-by: Guoli An <anguoli@uniontech.com> Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com> Link: https://patch.msgid.link/20250827-sound-quirk-min-mute-v1-1-4717aa8a4f6a@uniontech.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-08-26ALSA: usb-audio: us144mkii: Fixes for handshake, MIDI out and cleanupŠerif Rami3-3/+2
Add a handshake value of 0x32, which is required when the device was previously used by another OS with the official drivers. Correct the last byte of the MIDI output protocol to 0xe0. Also, remove the unused DRIVER_VERSION macro. Signed-off-by: Šerif Rami <ramiserifpersia@gmail.com> Link: https://patch.msgid.link/20250825072557.7670-1-ramiserifpersia@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-08-22ALSA: usb-audio: Add mute TLV for playback volumes on some devicesCryolitia PukNgae1-0/+2
Applying the quirk of that, the lowest Playback mixer volume setting mutes the audio output, on more devices. Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/2514 Cc: <stable@vger.kernel.org> Tested-by: Guoli An <anguoli@uniontech.com> Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com> Link: https://patch.msgid.link/20250822-mixer-quirk-v1-1-b19252239c1c@uniontech.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-08-21ALSA: usb-audio: Add validation of UAC2/UAC3 effect unitsTakashi Iwai1-2/+7
Just add fixed struct size validations for UAC2 and UAC3 effect units. The descriptor has a variable-length array, so it should be validated with a proper function later once when the unit is really parsed and used by the driver (currently only referred partially for the input terminal parsing). Link: https://patch.msgid.link/20250821151751.12100-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-08-21Merge branch 'for-linus' into for-nextTakashi Iwai2-4/+35
2025-08-21ALSA: usb-audio: Use correct sub-type for UAC3 feature unit validationTakashi Iwai1-1/+1
The entry of the validators table for UAC3 feature unit is defined with a wrong sub-type UAC_FEATURE (= 0x06) while it should have been UAC3_FEATURE (= 0x07). This patch corrects the entry value. Fixes: 57f8770620e9 ("ALSA: usb-audio: More validations of descriptor units") Link: https://patch.msgid.link/20250821150835.8894-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-08-20ALSA: usb-audio: us144mkii: Fix null-deref in tascam_midi_in_urb_complete()Šerif Rami1-2/+6
The smatch tool reported a potential null pointer dereference in tascam_midi_in_urb_complete(). The 'tascam' variable, derived from 'urb->context', was checked for nullity in one place, but dereferenced without a check in several other places. This patch fixes the issue by adding a null check at the beginning of the function. If 'tascam' is null, the function now safely exits. This prevents any potential crashes from null pointer dereferences. It also fixes a latent bug where 'usb_put_urb()' could be called twice for the same URB on submission failure, which would lead to a use-after-free error. Fixes: 67afec157fe6 ("ALSA: usb-audio: us144mkii: Add MIDI support and mixer controls") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202508192109.lcMrINK1-lkp@intel.com/ Signed-off-by: Šerif Rami <ramiserifpersia@gmail.com> Link: https://patch.msgid.link/20250819185133.10464-1-ramiserifpersia@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-08-19ALSA: usb-audio: us144mkii: Use le16_to_cpu() for product ID comparisonŠerif Rami1-2/+2
The `us144mkii.c` driver was generating sparse warnings due to direct comparisons of `dev->descriptor.idProduct` (a `__le16` type) with integer constants. This commit resolves these warnings by explicitly converting `idProduct` to a CPU-endian integer using `le16_to_cpu()` before comparison. This ensures correct handling of endianness and eliminates the sparse warnings: - `restricted __le16 degrades to integer` Fixes: dee1bcf28a3d ("ALSA: usb-audio: Add initial driver for TASCAM US-144MKII") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202508190811.tjQJZI1X-lkp@intel.com/ Signed-off-by: Šerif Rami <ramiserifpersia@gmail.com> Link: https://patch.msgid.link/20250819075118.9221-1-ramiserifpersia@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-08-18ALSA: usb-audio: Fix size validation in convert_chmap_v3()Dan Carpenter1-1/+1
The "p" pointer is void so sizeof(*p) is 1. The intent was to check sizeof(*cs_desc), which is 3, instead. Fixes: ecfd41166b72 ("ALSA: usb-audio: Validate UAC3 cluster segment descriptors") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/aKL5kftC1qGt6lpv@stanley.mountain Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-08-15ALSA: usb-audio: Add infrastructure for TASCAM US-144MKIIŠerif Rami3-6/+14
This commit adds Kconfig and Makefile entries for TASCAM US-144MKII USB audio/MIDI interface support. It includes the configuration option and links new driver files. The Kconfig entry for US-144MKII is added. The Makefile is updated to compile new driver components. The US-122L driver's device ID table is adjusted to remove the US-144MKII entry, as it will now be handled by its dedicated driver. Signed-off-by: Šerif Rami <ramiserifpersia@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250814172222.9448-8-ramiserifpersia@gmail.com
2025-08-15ALSA: usb-audio: us144mkii: Add deep sleep commandŠerif Rami2-0/+8
Add a deep sleep vendor command to be sent during suspend, allowing the device to enter a lower power state. Signed-off-by: Šerif Rami <ramiserifpersia@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250814172222.9448-7-ramiserifpersia@gmail.com