Message ID | 20230403-regmap-maple-unlock-v1-1-89998991b16c@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2561527vqo; Mon, 3 Apr 2023 13:19:28 -0700 (PDT) X-Google-Smtp-Source: AKy350bTQsn1qr0tSeQt0FHdH4Cwg1NVWkJvPpMg7UcuNmkjWNV+jXZv2TkOpCnVMc83dQbEjEet X-Received: by 2002:a17:903:11c4:b0:1a1:bff4:4a06 with SMTP id q4-20020a17090311c400b001a1bff44a06mr362712plh.24.1680553167868; Mon, 03 Apr 2023 13:19:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680553167; cv=none; d=google.com; s=arc-20160816; b=ZycHAptsK85dTdkkCUjjQQeRBzmAPR70RGVATi2A23kgh4+AX8oEUpdebS6/aMZLIO mZT0NvQ3sGjdaglCf5OsIkrUgTbDcW6RPLklBqzP5Cgu9+/var7V6/4p9QyDgN5kMbgw uwxGUihMOqV7TQqa9KQRtVMXh6NEe82rG+Tc9WmvE7AvLslh9t84bU28xVE6sPVlrbU2 HRAlIJ6eg3nCKEFFe+Qe6KohBA6VqU/0PUHbljm1RlY9sD/9p2anub3tzqN17yqz1xdg z0c48tcDh1KadDWYv7d7eMMue3YT+LaT16M1YeecC9TxCp4cul8dOKxznVtRtb1AkY+F 2sZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=EibnDdO/xO6F0g89v1sw1NIYwJHNGRCBvQKgGzHpZqI=; b=l+qJrKdIjPSu2EK51TiDx1HskuCG4nDABb2QWC1xM+MfPbJepqc++jxu5PPImxA6SP ZLg5ucKKh50acrKBhhz46SzlA1g2FP9UFMFNTmYRAEXZo0fHwX92SDt4Os7vz/RxAP/8 U1Lj0DkiCD123J5pNz+KttCVYXSveGqRz7P/2QKeldw6WbAbAt5JsVfdT8znE6VYzhab OG+IDxZtQVlIrsUEq7MEH7DXHpdZKH2WWefY97UtsOcY8apRajU9oJdtayWfCBuF2Brl 6NyBKyCAPrBMEDNoe3PIwt4ZpLMGfuwXNOKrnsD9JsisVBT3D7uxVjbRyccz6ZTF/OIe uyFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nSauXv4t; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j11-20020a170902da8b00b0019f24ac470bsi8641875plx.559.2023.04.03.13.19.15; Mon, 03 Apr 2023 13:19:27 -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=@kernel.org header.s=k20201202 header.b=nSauXv4t; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232029AbjDCUEO (ORCPT <rfc822;zwp10758@gmail.com> + 99 others); Mon, 3 Apr 2023 16:04:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbjDCUEN (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 3 Apr 2023 16:04:13 -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 C1BCA1728 for <linux-kernel@vger.kernel.org>; Mon, 3 Apr 2023 13:04:12 -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 51BE562124 for <linux-kernel@vger.kernel.org>; Mon, 3 Apr 2023 20:04:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1113C433EF; Mon, 3 Apr 2023 20:04:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680552251; bh=uKL7799fDYCIk1oIRYYxbDwmU1HnkOg8MZI/5uqJOcw=; h=From:Date:Subject:To:Cc:From; b=nSauXv4tR1sV566ZWCYZFpwkxijbPwswBYdm2hPi/HpRLgx0WLWYjB6Dft9NsZAvS yzWA1R0mIGML+grHJWqQctf+Y7x9sMJcY64ub6eysH2Z9BwjLrnl/FA+KEDuOS8som c/5VTkTHA5turHjoLZ64vs8Tf95BS1/+a05Op2yEbZYAyTbI+XX7cxdDkdOjPGd6xc 1H+Z4wyolUng8Vwb2CAEU9xmZ9qKJ26OOQiGt2BAexQhNcyT+u9wBQkWYte6L2at1g 4K8/dbGNeErHrcatsKFWLbvYVcNexz8BpO5ECiI2MT5LiU3yv9YO/2Pzc7bvT7OqMG iyZVrCNCAjYsQ== From: Mark Brown <broonie@kernel.org> Date: Mon, 03 Apr 2023 21:02:39 +0100 Subject: [PATCH] regmap: Fix double unlock in the maple cache MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230403-regmap-maple-unlock-v1-1-89998991b16c@kernel.org> X-B4-Tracking: v=1; b=H4sIAN4wK2QC/x2NywqDQAxFf0WybmCqI1p/pXQR06hBnZEMfYD47 x27uItz4XB2SGIqCbpiB5O3Jo0hw/VSAE8URkF9ZobSlZXzrkKTcaUN8xbBV1giz3hriVrP7Ju hhmz2lAR7o8DT6X6izee9mQz6/cfuj+P4AaWAle58AAAA To: Liam.Howlett@Oracle.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org> X-Mailer: b4 0.13-dev-00303 X-Developer-Signature: v=1; a=openpgp-sha256; l=1308; i=broonie@kernel.org; h=from:subject:message-id; bh=uKL7799fDYCIk1oIRYYxbDwmU1HnkOg8MZI/5uqJOcw=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBkKzE5rGUCZgJbyOewX95msrYoXSZ5YAHswnkVF8An tqHmm9OJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZCsxOQAKCRAk1otyXVSH0Bi9B/ wOc73skUgpb7dv93+EQLtllqEPZP9dRLr42t0weINyxyccdWmkVHOzv3RqU/NWFy/+H/eIqzDYs7OZ mpyfG9HQF7EqpBugq2CXzZUbYn2YzXeLs/HBcnt4fL00pYBX3nwYgq6p+h3dInwweEwpnnyFDqxdBV UPxkldRlm4aTceW8in79PLDgOVywS8NIe+X8XdcYpIprESQdMkwR834vqtKHg89EXLNAhN/OKoWqy2 YZ9IRIb+j3Hw2Xa703upoVTeXKf8XfFVKsF4Qy3t+AstBCR+MH2DqlH+ucMEa9oYLmfWLAZbQ4Wg5a Lv4y/+oDWl/xeWfTSq8ssdxbgzQCkA X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762187718356690395?= X-GMAIL-MSGID: =?utf-8?q?1762187718356690395?= |
Series |
regmap: Fix double unlock in the maple cache
|
|
Commit Message
Mark Brown
April 3, 2023, 8:02 p.m. UTC
Doing the dance to drop the maple tree's internal spinlock means we need
multiple exit paths in our error handling.
Reported-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/base/regmap/regcache-maple.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
base-commit: f033c26de5a5734625d2dd1dc196745fae186f1b
change-id: 20230403-regmap-maple-unlock-98aa84cc47f5
Best regards,
Comments
On Mon, 03 Apr 2023 21:02:39 +0100, Mark Brown wrote: > Doing the dance to drop the maple tree's internal spinlock means we need > multiple exit paths in our error handling. > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next Thanks! [1/1] regmap: Fix double unlock in the maple cache commit: 451941ac1ee2be125ac5029593a64b04badaa314 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
diff --git a/drivers/base/regmap/regcache-maple.c b/drivers/base/regmap/regcache-maple.c index 497cc708d277..20fb7228fc6b 100644 --- a/drivers/base/regmap/regcache-maple.c +++ b/drivers/base/regmap/regcache-maple.c @@ -137,7 +137,7 @@ static int regcache_maple_drop(struct regmap *map, unsigned int min, GFP_KERNEL); if (!lower) { ret = -ENOMEM; - goto out; + goto out_unlocked; } } @@ -151,7 +151,7 @@ static int regcache_maple_drop(struct regmap *map, unsigned int min, GFP_KERNEL); if (!upper) { ret = -ENOMEM; - goto out; + goto out_unlocked; } } @@ -179,6 +179,7 @@ static int regcache_maple_drop(struct regmap *map, unsigned int min, out: mas_unlock(&mas); +out_unlocked: kfree(lower); kfree(upper);