From patchwork Tue Dec 1 16:40:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 105180 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2296101lbb; Tue, 1 Dec 2015 08:41:20 -0800 (PST) X-Received: by 10.98.72.3 with SMTP id v3mr81715392pfa.148.1448988080109; Tue, 01 Dec 2015 08:41:20 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 28si10700300pfj.63.2015.12.01.08.41.19; Tue, 01 Dec 2015 08:41:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756062AbbLAQlS (ORCPT + 28 others); Tue, 1 Dec 2015 11:41:18 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:56300 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752561AbbLAQlQ (ORCPT ); Tue, 1 Dec 2015 11:41:16 -0500 Received: from cpc11-sgyl31-2-0-cust672.sgyl.cable.virginm.net ([94.175.94.161] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1a3nzI-0006n8-Hd; Tue, 01 Dec 2015 16:41:09 +0000 Received: from broonie by debutante with local (Exim 4.86) (envelope-from ) id 1a3nzF-00040s-ML; Tue, 01 Dec 2015 16:41:05 +0000 From: Mark Brown To: Thierry Reding , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, Tyler Baker , Mark Brown Date: Tue, 1 Dec 2015 16:40:57 +0000 Message-Id: <1448988057-13965-1-git-send-email-broonie@kernel.org> X-Mailer: git-send-email 2.6.2 X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mezzanine.sirena.org.uk X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.2 Subject: [PATCH] regulator: core: Ensure we lock all regulators X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The latest workaround for the lockdep interface's not using the second argument of mutex_lock_nested() changed the loop missed locking the last regulator due to a thinko with the loop termination condition exiting one regulator too soon. Reported-by: Tyler Baker Signed-off-by: Mark Brown --- Not tested yet. drivers/regulator/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.6.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index daffff83ced2..f71db02fcb71 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -141,7 +141,7 @@ static void regulator_lock_supply(struct regulator_dev *rdev) int i; mutex_lock(&rdev->mutex); - for (i = 1; rdev->supply; rdev = rdev->supply->rdev, i++) + for (i = 1; rdev; rdev = rdev->supply->rdev, i++) mutex_lock_nested(&rdev->mutex, i); }