Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp4790538rwb; Wed, 17 Aug 2022 06:14:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR4f+2D/A+Qe5ZFixkiDhhE9iYWGTrXmp5M5Kzo8Vh5a0vEbFLlEGtXA2Vod1Rxl3MpOc8v/ X-Received: by 2002:a17:902:f54e:b0:16f:206b:74cc with SMTP id h14-20020a170902f54e00b0016f206b74ccmr26828088plf.170.1660742098246; Wed, 17 Aug 2022 06:14:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660742098; cv=none; d=google.com; s=arc-20160816; b=w4Flaju2oPubRP3IKRgytrCsXzUREpvPY2SJ2bfoR5Xl4wL3v/9+OTKAu8c0in9oz0 CQDYin8YhsbfLyu7UBM9qM1uu4OFKAP+Z12lcSkbFYdZOypDA71GrMH+nWSR5QWLtqFA stAE/ItkZ0avGXvHVNOncPBzvqPPb1E5yf6lzqakQx5lFdTnAPKXP5MF/Qk5NVlv57to 1Rq2W+IrQ5cxygIHy/LfZhHjjEShaIleyTuMdi9solBnGti6QG9sattII4FNukOQxLdl 9MjUr3AvGrItYCXoWDcSi3MTQGWGf6Bz5ZcGWNFfvZl0M1p10O7nfe4innjSMsucJ1jq y7Eg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=KPlhtfOJDO61CGKZBvuYjL7+oxPD1KmTuElRYDDXaMY=; b=AcqaBz55FFLmWVp8XMH/ivNe4wdxNjQ6dacHJcJW42czhcg+ftxKm3SPfpg0LuQuy7 xO/9sWdCkkfmSW4LkULFUVoA1xoMBufMdxDUghD7DBb91eulGwrbGFfcm7dhbpRLhBrK HUh/41t77Rf2+PxvCyB9kahgM+OmvltIL2RLlEmUlNUlaQQ/bwXv0KvQs8zOPFWKUOEa Z67oy0eCTmEGOUfK5aGXKZc27UjRU4+HGjzDUw6x0q2mjvnSmv5AsldgHMUq2e5FM24G eyUYtZe7rkzlYMLDFqXsr5aoMZZrkzb8pRqxt86pajDfG9eMOr8CCimVgguMSMFxGeTT rKHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mSnfgGus; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l191-20020a6388c8000000b0041d9295f27bsi14765231pgd.733.2022.08.17.06.14.47; Wed, 17 Aug 2022 06:14:58 -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=@intel.com header.s=Intel header.b=mSnfgGus; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239213AbiHQMtO (ORCPT + 99 others); Wed, 17 Aug 2022 08:49:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236234AbiHQMtC (ORCPT ); Wed, 17 Aug 2022 08:49:02 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD77E6170A for ; Wed, 17 Aug 2022 05:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660740536; x=1692276536; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=kYOYATKAKktz41sDaZZq1GXiosh7ennmO+42v74MCX0=; b=mSnfgGusfF4aiuSvXeEM5drfB5nslroX7X4xMgPYqH3H84dEA5iYzTkJ VgKqgn1KAj628HCvq7Jl/PXulHgX8uaJoIp/fscjSfP4phMln9MRdFAYO h96ifpcEJ0akdqRDT57wxTqqCT88aLmZKKNvC0zeBGYIKMDBmTgeLH82t cmtOvBZs1Qs2Zpp+w9K+HyjmauF+FmxRo9fOOLCDQ76uKIXqDVzKNz2Sd SmdjRfUfj35zlErXSWDAChS5nnaqvyj962tKbuZwIkVjn12b9Nw/DyVQN xSQv5fYOS7WnA1kHX7pisIjS2Q/zGFa838SAhf7wv/fnEpn5rusVEynpZ g==; X-IronPort-AV: E=McAfee;i="6500,9779,10442"; a="292478318" X-IronPort-AV: E=Sophos;i="5.93,243,1654585200"; d="scan'208";a="292478318" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2022 05:48:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,243,1654585200"; d="scan'208";a="583755219" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga006.jf.intel.com with ESMTP; 17 Aug 2022 05:48:54 -0700 From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= To: Takashi Iwai , alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org, Cezary Rojewski , =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= Subject: [RESEND][PATCH] ALSA: info: Fix llseek return value when using callback Date: Wed, 17 Aug 2022 14:49:24 +0200 Message-Id: <20220817124924.3974577-1-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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". 73029e0ff18d ("ALSA: info - Implement common llseek for binary mode") Signed-off-by: Amadeusz Sławiński --- sound/core/info.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/core/info.c b/sound/core/info.c index b8058b341178..0b2f04dcb589 100644 --- a/sound/core/info.c +++ b/sound/core/info.c @@ -111,9 +111,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; } -- 2.25.1