From nobody Fri Sep 5 20:02:07 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA56BC32774 for ; Tue, 23 Aug 2022 11:48:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358443AbiHWLsp (ORCPT ); Tue, 23 Aug 2022 07:48:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358246AbiHWLog (ORCPT ); Tue, 23 Aug 2022 07:44:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A51DD11FE; Tue, 23 Aug 2022 02:30:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C83BE6139D; Tue, 23 Aug 2022 09:30:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D123FC433D6; Tue, 23 Aug 2022 09:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661247000; bh=ypEv1n++CtxAilts2e0nw7v+ULA4+1lQCQ2OdLMVVwA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wKoI6ilHeDLmIg3wVdm2+BZORR0UpCKYXyANPDC7676ZSIFLxAy4IIEd8/S9Zdfyv D17xb+q51kpXnM8L3Pceo+c4zguUWgxpZwEUbzfXeNO+8WnQIpRIHLpE92NNzlXIhY vyf0D6EB4wuTpR1wzW52sOifDHoibXGe4bXh1HWk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= , Takashi Iwai Subject: [PATCH 5.4 286/389] ALSA: info: Fix llseek return value when using callback Date: Tue, 23 Aug 2022 10:26:04 +0200 Message-Id: <20220823080127.501170663@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080115.331990024@linuxfoundation.org> References: <20220823080115.331990024@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Amadeusz S=C5=82awi=C5=84ski commit 9be080edcca330be4af06b19916c35227891e8bc upstream. When using callback there was a flow of ret =3D -EINVAL if (callback) { offset =3D callback(); goto out; } ... offset =3D some other value in case of no callback; ret =3D 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=C5=82awi=C5=84ski Cc: Link: https://lore.kernel.org/r/20220817124924.3974577-1-amadeuszx.slawinsk= i@linux.intel.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/core/info.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/sound/core/info.c +++ b/sound/core/info.c @@ -112,9 +112,9 @@ static loff_t snd_info_entry_llseek(stru entry =3D data->entry; mutex_lock(&entry->access); if (entry->c.ops->llseek) { - offset =3D entry->c.ops->llseek(entry, - data->file_private_data, - file, offset, orig); + ret =3D entry->c.ops->llseek(entry, + data->file_private_data, + file, offset, orig); goto out; } =20