Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932172AbbLEAmm (ORCPT ); Fri, 4 Dec 2015 19:42:42 -0500 Received: from mail.kernel.org ([198.145.29.136]:34461 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755477AbbLEAmk (ORCPT ); Fri, 4 Dec 2015 19:42:40 -0500 Date: Sat, 5 Dec 2015 01:42:36 +0100 From: Sebastian Reichel To: Julia Lawall Cc: kernel-janitors@vger.kernel.org, Dmitry Eremin-Solenikov , David Woodhouse , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Russell King - ARM Linux , Thomas Petazzoni , Andrew Lunn , Bjorn Helgaas , Jason Cooper Subject: Re: [PATCH 4/4] power/reset: at91-reset: add missing of_node_put Message-ID: <20151205004235.GD22936@earth> References: <1447884254-26336-1-git-send-email-Julia.Lawall@lip6.fr> <1447884254-26336-5-git-send-email-Julia.Lawall@lip6.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="C+ts3FVlLX8+P6JN" Content-Disposition: inline In-Reply-To: <1447884254-26336-5-git-send-email-Julia.Lawall@lip6.fr> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1971 Lines: 67 --C+ts3FVlLX8+P6JN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Wed, Nov 18, 2015 at 11:04:14PM +0100, Julia Lawall wrote: > for_each_matching_node performs an of_node_get on each iteration, so > a break out of the loop requires an of_node_put. >=20 > A simplified version of the semantic patch that fixes this problem is as > follows (http://coccinelle.lip6.fr): >=20 > // > @@ > expression e,e1; > local idexpression np; > @@ >=20 > for_each_matching_node(np, e1) { > ... when !=3D of_node_put(np) > when !=3D e =3D np > ( > return np; > | > + of_node_put(np); > ? return ...; > ) > ... > } > // >=20 > Signed-off-by: Julia Lawall Thanks, queued. -- Sebastian --C+ts3FVlLX8+P6JN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJWYjL7AAoJENju1/PIO/qa++sQAKGAm9AKyxpeq6va9JQfbQfi CQ+dUcMao/zMkxpmPEE41SWaiEb3bXqXuTEEnez8k4Y9t/aKINweZQGByhIzEV+8 XGPL7lR8+Cink6bUUF6konAm+tE1pJ7JqQoepTPMzvpjH0pL0pskcpP9L+da4d1y L6ty7vjT6TXtbj9zdbsIbBs9ms7kNNmurEGFD4ExvLvkEeEM0ieR1qDy2EamF6a1 XwQcxsT8ci6F+UBSNKLxIsSN2TRr3/+hYgkkylzwfQPBrg304HX8pW52GTT0dX7L ggUaLBVbLQhBVwHuZIfPRr4fBkA9drLYh2QepKN7xUrWbt9qTAt9+TtVBMZIzvj7 +0M+YpXKJFEJuDu0IuBqcRzDwvo03I79e4cUjZV5NMNiT9wPet3kUxWd7UZQLFjU 4RipWrRcmbXc/WBDhpeX71d7gGBoybYoR4LkPc2GxLjuEMW5TAjYYh023RFjhE0k sXvpcvk/9auzXPaZO192/tGToyF2wbonE0gxQiE262TWFgqLEX+smO0Dt7pZVLPg GPV14ZsAwx9UNPBwY0txWgcmTVTAR6Bu33zBjIhmTvtNjz65Kd/qorp2yHlW7CC3 K1vnWapQsa4uq7y8BbH7n8mcL49x8HzKoWsFy9XzpUHOVPW8PrVOy8V2ixtianpH t7K2yHI134eYDgWmGOox =pr/g -----END PGP SIGNATURE----- --C+ts3FVlLX8+P6JN-- -- 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/