From patchwork Wed Oct 4 06:05:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 9983883 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 43C1E60365 for ; Wed, 4 Oct 2017 06:05:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3301928A7C for ; Wed, 4 Oct 2017 06:05:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2614228A7E; Wed, 4 Oct 2017 06:05:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C95E28A7C for ; Wed, 4 Oct 2017 06:05:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751148AbdJDGFM (ORCPT ); Wed, 4 Oct 2017 02:05:12 -0400 Received: from mail-pg0-f50.google.com ([74.125.83.50]:44075 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750871AbdJDGFL (ORCPT ); Wed, 4 Oct 2017 02:05:11 -0400 Received: by mail-pg0-f50.google.com with SMTP id b1so4485056pge.1 for ; Tue, 03 Oct 2017 23:05:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=u3oJEI0z6jLo9CmA56ODkMNrU0caEua7PRQhgLl7mLk=; b=RdjZgov6JJP9jXDCT0D8w+RutRmd8QOOj/K6aM1hGVQsI9Uoiw8RsvyAkJO2tlNz45 5GKPh4cPHirLDZyK9qFmkuNgjuHwMzH/WEZGvCHZtPW3zZ3SmEzn7kCS6PtLyx1tEFNM JyGpurAPszoU5TY01q+mKxr3qhhwbCeEcXk00= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=u3oJEI0z6jLo9CmA56ODkMNrU0caEua7PRQhgLl7mLk=; b=tkiydmqEihjAm3JW5XYgPfx6PWxeMj38RiC4Y/7KBXHllH0kfS6pHbYba7NSPY1+o6 nzO1eLeifbyAeKA418QZCKTZuPcmFwqCZnu7SCivbULRNm5EWWE3djFx1zTWfS3/dZxQ gK38nP+jwvgGnKfZYfDEg3WSTBQiyukWDDBRuv+dhHSPaBIJx7QstW1n4sLxOYfsP75f 3GqLAJ71y4u9w6Ddvfzzah5/9U9nibuBEEJ6yYys143GdBVkFQPgNBofFF+MNkyxBhyi xer7d3tO+LfXKbla9S0JUuQ1ejVI1r24axgSgmw9M3KdNLad3bqW8AMpBBUB7dq5CC9J B2jA== X-Gm-Message-State: AHPjjUhAU3Y6xqiUk65RV4DMaetaFUXzRh9/BHazG1RpFn1ffniJvdwW aN6TfHPCO7PmDRrFw2J9wvqHtA== X-Google-Smtp-Source: AOwi7QDxq7DV1VRM2+BM8pD3bMi86QjUn7hphy6HKyfwjHuKEsALXdMELsLgWc90ZsQJJsUtGZo3Ew== X-Received: by 10.84.130.67 with SMTP id 61mr19467496plc.131.1507097111209; Tue, 03 Oct 2017 23:05:11 -0700 (PDT) Received: from localhost ([122.171.87.8]) by smtp.gmail.com with ESMTPSA id k24sm11980525pfj.151.2017.10.03.23.05.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Oct 2017 23:05:10 -0700 (PDT) From: Viresh Kumar To: Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Viresh Kumar , linux-pm@vger.kernel.org, Tobias Jordan , "4 . 3+" , linux-kernel@vger.kernel.org Subject: [PATCH] PM / OPP: Add missing of_node_put(np) Date: Wed, 4 Oct 2017 11:35:03 +0530 Message-Id: <3a82b2d3311e16f0f638de18bf0ee803540014a3.1507096875.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.14.1.202.g24db08a6e8fe Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tobias Jordan The for_each_available_child_of_node() loop in _of_add_opp_table_v2() doesn't drop the reference to "np" on errors. Fix that. Fixes: 274659029c9d ("PM / OPP: Add support to parse "operating-points-v2" bindings") Cc: 4.3+ # 4.3+ Signed-off-by: Tobias Jordan [ VK: Improved commit log. ] Signed-off-by: Viresh Kumar Reviewed-by: Stephen Boyd --- drivers/opp/of.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/opp/of.c b/drivers/opp/of.c index 0b718886479b..87509cb69f79 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -397,6 +397,7 @@ static int _of_add_opp_table_v2(struct device *dev, struct device_node *opp_np) dev_err(dev, "%s: Failed to add OPP, %d\n", __func__, ret); _dev_pm_opp_remove_table(opp_table, dev, false); + of_node_put(np); goto put_opp_table; } }