summaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>2022-08-17 14:49:24 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-25 11:15:33 +0200
commit69b1872b6da25d501011d868f2bc9c4e03fe8fa7 (patch)
tree29051dd21d7e64e0b5ba970fd297b070173b015e /sound/core
parent07256bae643199350f1c7a08afaea053ff6614d3 (diff)
downloadlinux-stable-69b1872b6da25d501011d868f2bc9c4e03fe8fa7.tar.gz
linux-stable-69b1872b6da25d501011d868f2bc9c4e03fe8fa7.tar.bz2
linux-stable-69b1872b6da25d501011d868f2bc9c4e03fe8fa7.zip
ALSA: info: Fix llseek return value when using callback
commit 9be080edcca330be4af06b19916c35227891e8bc upstream. 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: 73029e0ff18d ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/info.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/core/info.c b/sound/core/info.c
index 3fa8336794f8..2ac656db0b1c 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -127,9 +127,9 @@ static loff_t snd_info_entry_llseek(struct file *file, loff_t offset, int orig)
entry = data->entry;
mutex_lock(&entry->access);
if (entry->c.ops->llseek) {
- offset = entry->c.ops->llseek(entry,
- data->file_private_data,
- file, offset, orig);
+ ret = entry->c.ops->llseek(entry,
+ data->file_private_data,
+ file, offset, orig);
goto out;
}