]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ALSA: aoa: Fix I2S device accounting
authorTakashi Iwai <tiwai@suse.de>
Thu, 27 Oct 2022 06:52:33 +0000 (08:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 14:50:57 +0000 (23:50 +0900)
commit15ae48e16eddbc90f66d031c5490e32a69b524f7
treef593db81359a0cdc95ba422345d8076ddf67d45f
parent802532a50acf501fdafe38a84ca2aa886d68af68
ALSA: aoa: Fix I2S device accounting

[ Upstream commit f1fae475f10a26b7e34da4ff2e2f19b7feb3548e ]

i2sbus_add_dev() is supposed to return the number of probed devices,
i.e. either 1 or 0.  However, i2sbus_add_dev() has one error handling
that returns -ENODEV; this will screw up the accumulation number
counted in the caller, i2sbus_probe().

Fix the return value to 0 and add the comment for better understanding
for readers.

Fixes: f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa")
Link: https://lore.kernel.org/r/20221027065233.13292-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/aoa/soundbus/i2sbus/core.c