Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754429Ab3DWC4a (ORCPT ); Mon, 22 Apr 2013 22:56:30 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:47997 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754343Ab3DWC41 (ORCPT ); Mon, 22 Apr 2013 22:56:27 -0400 X-AuditID: cbfee68f-b7feb6d000003f6c-42-5175f8594a44 From: Jonghwan Choi To: "'Jonghwan Choi'" , linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, "'Andrzej Hajda'" , "'Liam Girdwood'" , "'Mark Brown'" References: In-reply-to: Subject: [PATCH 3.8-stable] regulator: fixed regulator_bulk_enable unwinding code Date: Tue, 23 Apr 2013 11:56:25 +0900 Message-id: <006f01ce3fce$25072080$6f156180$%choi@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac4vhL6OHdYi6A9aR4m9yzeDEXJPogAflJswAu8tBWABA4TFIA== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOIsWRmVeSWpSXmKPExsVy+t8zfd3IH6WBBgs/WFncWneO1eLf7FNs FkuauS0u75rDZtG0fQK7xYKNjxgd2DxeTvzN5tG3ZRWjx/Eb25k8Pm+SC2CJ4rJJSc3JLEst 0rdL4Mo4++YUe8EUror3V5ewNDDu4ehi5OSQEDCROPakgR3CFpO4cG89WxcjF4eQwDJGiW3d newwRQu3HGCHSCxilOjpn8wK4fxllNixq5UVpIpNQFfi2PotYLaIgLfEqSm/mEGKmAWmM0pM eNkAlOAA6uCWWN0cBFLDKcAjse5PJzOILSwQLPFj51Q2EJtFQFWi73IbC4jNK2AncfxaLzOE LSjxY/I9sDizgJbE+p3HmSBseYnNa94yg4yXEFCXePRXF+IEJ4mfix+xQpSISOx78Y4R5BwJ gXvsEpv7D7NA7BKQ+Db5EAt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I3MLIxMzM1JE1YS5z3Yah0oJJCeWJKanZpakFoEs4WJg1Oq gZFrJuOL3/aLnOqaZ1g9WDmvN33/yUyjCqGYJ3osicuepHhUtnrfOBZotPWVY9CmU992HPTL 6Phz5sLqzv708z1uwRPD/dp6fq85rHvvUHP/zSSn+fu4s45+tJPNf3vr6sRQGZ2PDU+vCJ4u +3ZF/aFQx3OZJ31cc6Jz2O+5aXBs3C5ZXR1dr63EUpyRaKjFXFScCADgoti0RwMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1501 Lines: 49 3.8-stable review patch. If anyone has any objections, please let me know. ------------------ From: "Andrzej Hajda " commit fbe31057fafebdc2811a7101b8b4a0460f5417d1 upstream. Unwinding code disables all successfully enabled regulators. Error is logged for every failed regulator. Signed-off-by: Andrzej Hajda Signed-off-by: Kyungmin Park Signed-off-by: Mark Brown Signed-off-by: Jonghwan Choi --- drivers/regulator/core.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 5a0f54a..e56185b 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -3032,9 +3032,13 @@ int regulator_bulk_enable(int num_consumers, return 0; err: - pr_err("Failed to enable %s: %d\n", consumers[i].supply, ret); - while (--i >= 0) - regulator_disable(consumers[i].consumer); + for (i = 0; i < num_consumers; i++) { + if (consumers[i].ret < 0) + pr_err("Failed to enable %s: %d\n", consumers[i].supply, + consumers[i].ret); + else + regulator_disable(consumers[i].consumer); + } return ret; } -- 1.7.9.5 -- 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/