Skip to content

Commit 9be080e

Browse files
Amadeusz Sławińskitiwai
authored andcommitted
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: 73029e0 ("ALSA: info - Implement common llseek for binary mode") Signed-off-by: Amadeusz Sławiński <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 1ff954f commit 9be080e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sound/core/info.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ static loff_t snd_info_entry_llseek(struct file *file, loff_t offset, int orig)
111111
entry = data->entry;
112112
mutex_lock(&entry->access);
113113
if (entry->c.ops->llseek) {
114-
offset = entry->c.ops->llseek(entry,
115-
data->file_private_data,
116-
file, offset, orig);
114+
ret = entry->c.ops->llseek(entry,
115+
data->file_private_data,
116+
file, offset, orig);
117117
goto out;
118118
}
119119

0 commit comments

Comments
 (0)