Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2639386rdb; Wed, 4 Oct 2023 07:18:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRBo5K8wc57+9J83UkDOMx4LO/eEdieLez4sHEATXDH54DguuXuRry+NhCHh5NT+3rCOHz X-Received: by 2002:a17:90b:4f8c:b0:26f:f272:144c with SMTP id qe12-20020a17090b4f8c00b0026ff272144cmr2078670pjb.27.1696429106722; Wed, 04 Oct 2023 07:18:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696429106; cv=none; d=google.com; s=arc-20160816; b=rCGplccXkUCzwLhxKPtwKPWPLYGiuna66XRal2NQp0gupMHx8kjlEKcBOQRufJcAeP 3WpMZFOgpoD19+PwentaIhvmBl4qEgLKHrpum16yhxI2T4AHFGrGvGlaln+Uek8knYi5 unUk0l5OZ2fqbJg3f6OLgr4ykMoXFFtXxoWIEZNslWOUg8b0iH4EMFJU4pDe0g0D0Nxw f94XOszYomnSJEsrS/oUX3SThat54qY0wPNAYL01UteHn4gzB2XZmAQ5jB1YOau8Vn5C 2bJS1sy8thPqvMLaC+m4A+zuCOAXrXRCu4WJeV/Ak5YmxAO1vg+CiqFQeWu89p1d0paf l8Pg== 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=R6/TWL/5A64z3k0Lwl1E33nP72so44fTzxRPPV1CpcA=; fh=8UFse30h+Bvq6hI0j6AowB7kDGcBe5/8fN5O4liF2x0=; b=d93dwRhccPp7Py3ibdcneof8yl/jjAdJ95RZ0Ps6rGDzhrwozbAQ/SnbcA1P/em1mn S0DF3+8i+rxRVikbCi5m6IpPXEkJ64eryaO3jbG1LDk+FXuijVFwIhoBqgj1wzwRNaWL BWhqRqPad7SCXeZgtXST2Ar20ttNkWtGnotKhzsN8qrW0YqSMZiyeM0/I8HSjb+B/8eq 6g0OB90x5RsluvrWpRMcToGtgms2N/5zWIq+yBs3YlzPEX5IW8JZTenwbANPxZJ84AfC Z7BFrp3Av6pZJmQ9GwudzEEtnAnP7+WuHWbI4M5Zyxrs0kh8M7Yh/fL2yrEMmp9Mrlh/ I0Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=IBdP0jUY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id co11-20020a17090afe8b00b002790fa91d77si1539044pjb.145.2023.10.04.07.18.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 07:18:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=IBdP0jUY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 912E0821A15E; Wed, 4 Oct 2023 07:18:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242897AbjJDOSL (ORCPT + 99 others); Wed, 4 Oct 2023 10:18:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242870AbjJDOSK (ORCPT ); Wed, 4 Oct 2023 10:18:10 -0400 Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D08DC6 for ; Wed, 4 Oct 2023 07:18:03 -0700 (PDT) Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3af5fcb5e37so1416131b6e.0 for ; Wed, 04 Oct 2023 07:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1696429083; x=1697033883; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=R6/TWL/5A64z3k0Lwl1E33nP72so44fTzxRPPV1CpcA=; b=IBdP0jUYj4jZAgYuXmVD15BLL9LpAM28u30yQXTukgswU49v3Csy9bJz7wuhSxseWT yAZk6PryErWmkMBNFPzR9AW4V4tbAEE13/NSRsRl1cMvF5mi80/WmLYyUaKB9ekkzBUW VePUqa3BYCA0Ie0cR6WE3SkXBSylLKnaPCCUxRLs3/Vo0V++gLdF+gTw6uJEastwvRpK HlOXvmRneZCZWEAp5e3xh6xjpg9tVeKFmEmY5wbj6ulXQrneKT/MQnKyTbCEzo64ZLvx zQa0Vqtna+2ViI5eu2Zl/8hIKXE8jp/pQeuPa7RAmh7G0Pp3LgXqf12OnyW30H9fIHr8 GhLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696429083; x=1697033883; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=R6/TWL/5A64z3k0Lwl1E33nP72so44fTzxRPPV1CpcA=; b=NaaNbVAGZ6/8EX8ScX1LMPoDqX6YA1wC61dQaL8xtTZ9nCLPe0ELGwWeIdENLLh8as YatZUUCG2Jns5Qy2unoItKRL4sviFMGFMySyo9KHe5WQOuCfEQkV4E9mnweRODY0hRSu QRI1vK1EvqPHsBwPAc6fqQ29qqAG1sgHWNNyd3AfWerLv+MqXNfen2cQgWC9DW5sSghb PDIsE4+pPzqTnytSdE6uIXbSnOPNdena1aYVVaZNaQEf7rOfhxSFk7J/A+SiLHXGaRuU G7nB8Jz6X0DywuTIQsry3SLCxuWbUMv5euC/0g26S5uMriZFsuwCP9ZbQZn38Ez8Q/FT FmRw== X-Gm-Message-State: AOJu0Yxd7ThkvrzEXCjAz/a0YEBhR5IrKXpwUG0YicgnR8VendN6mgvF WwiAU4TZqTJN3AInyxx2NAhQAg== X-Received: by 2002:a05:6808:23cd:b0:3a3:b39d:a8bf with SMTP id bq13-20020a05680823cd00b003a3b39da8bfmr3100444oib.45.1696429082602; Wed, 04 Oct 2023 07:18:02 -0700 (PDT) Received: from freyr.lechnology.com (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id dz14-20020a056808438e00b003a78d196acasm523761oib.32.2023.10.04.07.18.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 07:18:02 -0700 (PDT) From: David Lechner To: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev Cc: David Lechner , Jonathan Cameron , Michael Hennerich , linux-kernel@vger.kernel.org, kernel test robot , Dan Carpenter Subject: [PATCH] staging: iio: resolver: ad2s1210: fix return with lock held Date: Wed, 4 Oct 2023 09:17:26 -0500 Message-ID: <20231004-staging-iio-resolver-ad2s1210-fix-return-with-lock-held-v1-1-812b932997bd@baylibre.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Mailer: b4 0.12.3 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 07:18:25 -0700 (PDT) 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; /* 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