]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: info: Fix llseek return value when using callback
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Wed, 17 Aug 2022 12:49:24 +0000 (14:49 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 17 Aug 2022 13:13:30 +0000 (15:13 +0200)
commitd9f25baf620fed8cd3a4eedd46be1d8ccc7804f2
tree9c8bedf219f8731067fd00ff458d396d35ad56b1
parentcd002544ac0734940dd3d8c47433cbf5f0cf58d3
ALSA: info: Fix llseek return value when using callback

When using callback there was a flow of

ret = -EINVAL
if (callback) {
offset = callback();
goto out;
}
...
offset = some other value in case of no callback;
ret = offset;
out:
return ret;

which causes the snd_info_entry_llseek() to return -EINVAL when there is
callback handler. Fix this by setting "ret" directly to callback return
value before jumping to "out".

Fixes: 7249eb18220b ("ALSA: info - Implement common llseek for binary mode")
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220817124924.3974577-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/info.c