Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3474298rwa; Tue, 23 Aug 2022 05:28:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR4HQFA1ZCiNX83xja0zfeHTtZ9ZNM9ge3oaxmzn3WChc2xj1vX5IRVbaLDJbvFzqgo8+I6b X-Received: by 2002:a17:90a:414f:b0:1fb:29d9:7989 with SMTP id m15-20020a17090a414f00b001fb29d97989mr3162965pjg.70.1661257728707; Tue, 23 Aug 2022 05:28:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257728; cv=none; d=google.com; s=arc-20160816; b=bDLrQFobdgkr7R5KTANNlUBdd35inxDx03tqhKE1UNPFc3X89rhF1hOlnkw4kQ0cpJ 9lX/mkbkI29P2pCWPmcKAe3fhtqJyZzpF6nyH/uqcAQpjFOFBbemQev7uqFUxmpanYQJ PUu3Ggfq9pMDWDiVknUnzCQrs7I4+NHY7edJ7X7wIhTDgRAamiD7xqSKvzDJsEPJttct Yq9SX1HEhTeU/yEmi6u3OShVYd91q+xbhkOcB+unUJ5ZwAHe8/BKnIU0p+XAFxn4YyIe guKMGXG9f7jBc+MK3OMnqiX7c7t8jMjus5C2a6gA1BKeLmeDFGyxiRRZ4U7dF8W7DkRu M9cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=F0MMTPie/wIsZR8m8grsS0poQaqbf6tasINLnH57FK0=; b=P3hIudtNQjFisZOpUBNF06iBZdvOaSL6Z1P0evSWZ3vHX5Me2nJUU2Mn8bOa+WpVVi tmxrerD6h6WMq8fSZZXqXKKpo/zzAsK+XH+lXRcS1K9dpHND/vhM/m1yvLe6Coq9JAv3 FrBvscpzTG5hEzmMUVyju6C4qZ5Xg8dPhfzj1AtZ9TxelyCzoPKvperqCU25cdmHVayW XQwGeltJS2EvpBkl6ER4MSRXawBFCJdQOfIQ4BZ/saVj4cpdnIeaAG8ASvsYKg01YkqT md4EoEIVNDkk635SXuSPJynbG3GujMMe5u1d4pn0bfgftxm6TfDtJCBCrK8EQkF08X4K 03dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="rivc/sPX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u20-20020a056a00159400b0052b8da96658si16336384pfk.26.2022.08.23.05.28.37; Tue, 23 Aug 2022 05:28:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="rivc/sPX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353599AbiHWKLl (ORCPT + 99 others); Tue, 23 Aug 2022 06:11:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352161AbiHWKEh (ORCPT ); Tue, 23 Aug 2022 06:04:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4119671724; Tue, 23 Aug 2022 01:51:32 -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 A0A086150F; Tue, 23 Aug 2022 08:51:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8494C433D6; Tue, 23 Aug 2022 08:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244691; bh=IKMkzTsYh/OjMKBcBRBsOD5re4x3laIipvrW/22RXUE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rivc/sPXU4ei2BrY2oMC7jqOgq8fvjvCR23NaPQPnie+yy5nP5Ogx8E/U8TNLV1b8 xBUOa4tUe+B2SqBlB8J0B/9PKlPCbqjPls0DRYskrQLusJdHpZS9FTRm8kJ7b4S+GT mKQALecrGHSQ7zn5Lx6AM9Q0LZiVANdtmY1tC9AQ= 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 4.14 176/229] ALSA: info: Fix llseek return value when using callback Date: Tue, 23 Aug 2022 10:25:37 +0200 Message-Id: <20220823080059.901302464@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Amadeusz Sławiński 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 Cc: Link: https://lore.kernel.org/r/20220817124924.3974577-1-amadeuszx.slawinski@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 @@ -127,9 +127,9 @@ static loff_t snd_info_entry_llseek(stru 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; }