Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp348717rdb; Thu, 5 Oct 2023 07:44:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXtSht130qQz6EuOniz6aCENbqdFfVV1bEG49fgzqisEKjWZg7Bu4t7x7Q7MqwFWVHE0wh X-Received: by 2002:a17:902:e843:b0:1c5:cc30:7329 with SMTP id t3-20020a170902e84300b001c5cc307329mr6428799plg.54.1696517065195; Thu, 05 Oct 2023 07:44:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696517065; cv=none; d=google.com; s=arc-20160816; b=Pimu16RG0mJquZLzi+2l/4u22bYIpK1tb/4pcgox5lEZfmxMPA8HlrSnxDMX7kbi2T Kj2NarPnL62xP0wgMv6rKMVWvh2s9ErUNWCkF2+EIKxlNcJ7JHwHOGyWLBkhZ5JMaiAw gjjGneciJ7Mp6Cmhz8YQalz2s5xqmnV7bDpp56PK1JoovJRPAyrqAKtbdNFG2olgudO3 t7a0BKmmxHRvBFgyQbtzeN0NbKZx7gwLQZ2WkmNrKvXbS/98WoyPqsRH/1KF381FDzZS XvRWM8QtuHGsy6KD3WHdJ/mhCP4ZqJl6pjUhyBOfPEBChOnAU0EXZxI9BSh4zcd+bNSi qhkA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=/gpkF/EuiJlGXe+YFVDljs8YwnNqNv+sZUKvk893JN4=; fh=vkfG6Mrzx95zVax5NJibxz60QuH/DI8OWb5J0FdSGMg=; b=uMpE1NVoN67C15u8UsQHb5Yk8zfXJFaFbcfZBCvEbLX3Ukuo7O111Rwp32X3Sz8twX 1GZTLy/RW0hcDjOb/EH8XcQu/lSwUFcuJFcUS6YBrfgxbKdzMCpbugLELrkfNQZMbUwE z0h4KGa4ykQ+xwFcJhyHTWbybOzzRTmJwkDvztH/CLGQ/2+BVd5C9FKiS7admuhdQLVU 6CQH7yCuUo+pdoK2yweca1UhIcZ2wJ7mlY95TqPfywcLrsK/KqaSuS3vrHfKYrUWUg96 4Hm0iFEidaRDPdswHD/o5k7ClwiXwvxa7yjk76mdgPPfxgHRKNbRPsdcPY3MDHYHK/74 vzEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=unHERqPd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id f6-20020a17090274c600b001c60d6a620bsi1603394plt.95.2023.10.05.07.44.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 07:44:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=unHERqPd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id DB9288232B23; Thu, 5 Oct 2023 07:44:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237124AbjJEOnH (ORCPT + 99 others); Thu, 5 Oct 2023 10:43:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235741AbjJEOi2 (ORCPT ); Thu, 5 Oct 2023 10:38:28 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC3334E364; Thu, 5 Oct 2023 07:03:59 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C699C43397; Thu, 5 Oct 2023 14:03:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696514639; bh=piLsE53Q1gZgSQFUl07BSGRXu3dJHS5CexWfLgjoioM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=unHERqPdEuFsnlwkj8m5qiTQxIrHwyFBS4Ylk8EvqN9DZvHS4F+PgVWWJRKs04qLZ UjVvRObXsKf1C+0743hADeJSmBxP16oo6/prqwkUa5/B/g2/5ySPticvvoJbK7GcqV M+4dx6jkCc5RZUJio1GnO1OPuS67YePnXZKRrA1TDVxlm0Ft6NAgRA+UTdQEOL7ueQ RQzgSQEtCMQvVsa960b2UCCpCFrLYuvRs9u64LzUUSwrejrOgXU9HSEfPm+8RZ/D9k Fwc+vjtTmBFauSo73drSeW5QhEYYlYo8fU/5QTZ0oQxYtDDKVBzCDqLdLNT+RdTh2V jtv3yMjVoxJqg== Date: Thu, 5 Oct 2023 15:04:03 +0100 From: Jonathan Cameron To: David Lechner Cc: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev, Michael Hennerich , linux-kernel@vger.kernel.org, kernel test robot , Dan Carpenter Subject: Re: [PATCH] staging: iio: resolver: ad2s1210: fix return with lock held Message-ID: <20231005150403.453851f3@jic23-huawei> In-Reply-To: <20231004-staging-iio-resolver-ad2s1210-fix-return-with-lock-held-v1-1-812b932997bd@baylibre.com> References: <20231004-staging-iio-resolver-ad2s1210-fix-return-with-lock-held-v1-1-812b932997bd@baylibre.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 05 Oct 2023 07:44:09 -0700 (PDT) On Wed, 4 Oct 2023 09:17:26 -0500 David Lechner wrote: > We missed a return statement in ad2s1210_initial() that would cause > the lock to be held when returning an error. > > This is fixed by replacing the return with a goto to release the lock > before returning. > > Reported-by: kernel test robot > Reported-by: Dan Carpenter > Closes: https://lore.kernel.org/r/202310030222.iokamE9T-lkp@intel.com/ > Fixes: 0d03d0e65846 ("staging: iio: resolver: ad2s1210: rework gpios") > Signed-off-by: David Lechner > --- > drivers/staging/iio/resolver/ad2s1210.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c > index 98afd2e9ea41..67d8af0dd7ae 100644 > --- a/drivers/staging/iio/resolver/ad2s1210.c > +++ b/drivers/staging/iio/resolver/ad2s1210.c > @@ -555,7 +555,7 @@ static int ad2s1210_initial(struct ad2s1210_state *st) > mutex_lock(&st->lock); > ret = ad2s1210_set_resolution_gpios(st, st->resolution); > if (ret < 0) > - return ret; > + goto error_ret; Ah. I squashed the same fix into the original patch as it wasn't yet on a non rebasing tree. Thanks Jonathan > > /* Use default config register value plus resolution from devicetree. */ > data = FIELD_PREP(AD2S1210_PHASE_LOCK_RANGE_44, 1); > > --- > base-commit: a533eeaef80e879b3ad1937eee7a43d1f9961c5d > change-id: 20231004-staging-iio-resolver-ad2s1210-fix-return-with-lock-held-f547ce6fae49