* [PATCH] ALSA: firewire-lib: fix return value on fail in amdtp_tscm_init()
@ 2024-11-01 18:55 Murad Masimov
2024-11-04 10:25 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Murad Masimov @ 2024-11-01 18:55 UTC (permalink / raw)
To: Clemens Ladisch
Cc: Murad Masimov, Takashi Sakamoto, Jaroslav Kysela, Takashi Iwai,
linux-sound, linux-kernel, lvc-project
If amdtp_stream_init() fails in amdtp_tscm_init(), the latter returns zero,
though it's supposed to return error code, which is checked inside
init_stream() in file tascam-stream.c.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 47faeea25ef3 ("ALSA: firewire-tascam: add data block processing layer")
Signed-off-by: Murad Masimov <m.masimov@maxima.ru>
---
sound/firewire/tascam/amdtp-tascam.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/firewire/tascam/amdtp-tascam.c b/sound/firewire/tascam/amdtp-tascam.c
index 0b42d6559008..079afa4bd381 100644
--- a/sound/firewire/tascam/amdtp-tascam.c
+++ b/sound/firewire/tascam/amdtp-tascam.c
@@ -238,7 +238,7 @@ int amdtp_tscm_init(struct amdtp_stream *s, struct fw_unit *unit,
err = amdtp_stream_init(s, unit, dir, flags, fmt,
process_ctx_payloads, sizeof(struct amdtp_tscm));
if (err < 0)
- return 0;
+ return err;
if (dir == AMDTP_OUT_STREAM) {
// Use fixed value for FDF field.
--
2.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: firewire-lib: fix return value on fail in amdtp_tscm_init()
2024-11-01 18:55 [PATCH] ALSA: firewire-lib: fix return value on fail in amdtp_tscm_init() Murad Masimov
@ 2024-11-04 10:25 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2024-11-04 10:25 UTC (permalink / raw)
To: Murad Masimov
Cc: Clemens Ladisch, Takashi Sakamoto, Jaroslav Kysela, Takashi Iwai,
linux-sound, linux-kernel, lvc-project
On Fri, 01 Nov 2024 19:55:13 +0100,
Murad Masimov wrote:
>
> If amdtp_stream_init() fails in amdtp_tscm_init(), the latter returns zero,
> though it's supposed to return error code, which is checked inside
> init_stream() in file tascam-stream.c.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: 47faeea25ef3 ("ALSA: firewire-tascam: add data block processing layer")
> Signed-off-by: Murad Masimov <m.masimov@maxima.ru>
Applied now. Thanks.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-04 10:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-01 18:55 [PATCH] ALSA: firewire-lib: fix return value on fail in amdtp_tscm_init() Murad Masimov
2024-11-04 10:25 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®