Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1244344
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!news.albasani.net!weretis.net!feeder1.news.weretis.net!newsfeed.CARNet.hr!news.spin.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Krzysztof Kozlowski <k.kozlowski@samsung.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/5] power_supply: charger-manager: add missing of_node_put |
| Date | Mon, 12 Oct 2015 04:30:02 +0200 |
| Message-ID | <qiB2a-25v-9@gated-at.bofh.it> (permalink) |
| References | <qi1L3-18e-9@gated-at.bofh.it> <qi1L3-18e-7@gated-at.bofh.it> |
| X-Original-To | Julia Lawall <Julia.Lawall@lip6.fr> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=AjuWcxPdJt8MPHdO3cTrb9EEkpdB+omDEDg2KQzWJ4k=; b=HLn/yt/OpJdpcS/e2RGIx+0q1p+ae4SjUIXq71WpHe4ff3Mibh5a/873lSGQ16Q72Y 8SXsPIWcJchijsTIX/a9X1qPjoWBKcRGogqgQ5H5aXNyo6L90WUPSNCuar5AFXJfI8t+ 3uWuBqh3Rs5lnqLOrJrGQNpCTtZitPm3cKPMO1TGhnPMQLeVuPVr/cLsUFQNKfmTV0xP 2O8mxmSYiBFE0T52rHldVUrcrGqPkcePyrIQoEDCfme7ZLDIiAC2+JpcvFo9eZvFe/Ud yWEmhu4pieAKAhl9+DEfLsV0aHXlZmbBT2NTnqx2N932WFkDhxXjA+Vkyyrj33VRFmu6 gjrg== |
| MIME-Version | 1.0 |
| X-Received | by 10.140.22.48 with SMTP id 45mr29653638qgm.23.1444616433265; Sun, 11 Oct 2015 19:20:33 -0700 (PDT) |
| X-Google-Sender-Auth | H_DIMFzZ0X68FfJscXBeSf-Sagg |
| Content-Type | text/plain; charset=UTF-8 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 42 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Sebastian Reichel <sre@kernel.org>, kernel-janitors@vger.kernel.org, Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>, David Woodhouse <dwmw2@infradead.org>, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Russell King - ARM Linux <linux@arm.linux.org.uk>, Thomas Petazzoni <thomas.petazzoni@free-electrons.com>, Andrew Lunn <andrew@lunn.ch>, Bjorn Helgaas <bhelgaas@google.com>, Jason Cooper <jason@lakedaemon.net> |
| X-Original-Date | Mon, 12 Oct 2015 11:20:33 +0900 |
| X-Original-Message-ID | <CAJKOXPc+42NMUkvnned-CcjKGzPt8KRUORV9ex3tuq+=_HBW0w@mail.gmail.com> |
| X-Original-References | <1444480254-14399-1-git-send-email-Julia.Lawall@lip6.fr> <1444480254-14399-3-git-send-email-Julia.Lawall@lip6.fr> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1244344 |
Show key headers only | View raw
2015-10-10 21:30 GMT+09:00 Julia Lawall <Julia.Lawall@lip6.fr>:
> for_each_child_of_node performs an of_node_get on each iteration, so
> a break out of the loop requires an of_node_put.
>
> The semantic patch that fixes this problem is as follows
> (http://coccinelle.lip6.fr):
>
> // <smpl>
> @@
> expression root,e;
> local idexpression child;
> @@
>
> for_each_child_of_node(root, child) {
> ... when != of_node_put(child)
> when != e = child
> (
> return child;
> |
> + of_node_put(child);
> ? return ...;
> )
> ...
> }
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
> drivers/power/charger-manager.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Best regards,
Krzysztof
--
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/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 2/5] power_supply: charger-manager: add missing of_node_put Julia Lawall <Julia.Lawall@lip6.fr> - 2015-10-10 14:50 +0200 Re: [PATCH 2/5] power_supply: charger-manager: add missing of_node_put Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-10-12 04:30 +0200 Re: [PATCH 2/5] power_supply: charger-manager: add missing of_node_put Sebastian Reichel <sre@kernel.org> - 2015-10-15 11:00 +0200
csiph-web