]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ALSA: caiaq: Fix control_put() result and cache rollback
authorCássio Gabriel <cassiogabrielcontato@gmail.com>
Fri, 17 Apr 2026 13:41:33 +0000 (10:41 -0300)
committerTakashi Iwai <tiwai@suse.de>
Fri, 17 Apr 2026 15:52:00 +0000 (17:52 +0200)
commita3542d1b30f92307f545f2def14e8d988dffdff0
tree9974558e84eedec330c6ef652fe92158c627dd63
parent4ff036f95238f02c87e5d7c0a9d93748582a8950
ALSA: caiaq: Fix control_put() result and cache rollback

control_put() always returns 1 and updates cdev->control_state[]
before sending the USB command. It also ignores transport errors
from usb_bulk_msg(), snd_usb_caiaq_send_command(), and
snd_usb_caiaq_send_command_bank().

That breaks the ALSA .put() contract and can leave control_get()
reporting a cached value the device never accepted.

Return 0 for unchanged values, propagate transport failures,
and restore the cached byte when the write fails.

Fixes: 8e3cd08ed8e59 ("[ALSA] caiaq - add control API and more input features")
Cc: stable@vger.kernel.org
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Link: https://patch.msgid.link/20260417-caiaq-control-put-v1-1-c37826e92447@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/caiaq/control.c