From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761021AbYFINKy (ORCPT ); Mon, 9 Jun 2008 09:10:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751728AbYFINKq (ORCPT ); Mon, 9 Jun 2008 09:10:46 -0400 Received: from chilli.pcug.org.au ([203.10.76.44]:51420 "EHLO smtps.tip.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998AbYFINKp (ORCPT ); Mon, 9 Jun 2008 09:10:45 -0400 Date: Mon, 9 Jun 2008 23:10:37 +1000 From: Stephen Rothwell To: Julia Lawall Cc: benh@kernel.crashing.org, linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH 4/4] drivers/macintosh/therm_adt746x.c: add missing of_node_put Message-Id: <20080609231037.b8aa7561.sfr@canb.auug.org.au> In-Reply-To: References: X-Mailer: Sylpheed 2.5.0rc (GTK+ 2.12.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Mon__9_Jun_2008_23_10_37_+1000_HKYG/_Axzb=z6d7v" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Signature=_Mon__9_Jun_2008_23_10_37_+1000_HKYG/_Axzb=z6d7v Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, 9 Jun 2008 14:21:51 +0200 (CEST) Julia Lawall wrote: > > From: Julia Lawall >=20 > of_node_put is needed before discarding a value received from > of_find_node_by_name, eg in error handling code. >=20 > The semantic patch that makes the change is as follows: > (http://www.emn.fr/x-info/coccinelle/) >=20 > // > @@ > struct device_node *n; > struct device_node *n1; > statement S; > identifier f; > expression E; > constant C; > @@ >=20 > n =3D of_find_node_by_name(...) > ... > if (!n) S > ... when !=3D of_node_put(n) > when !=3D n1 =3D f(n,...) > when !=3D E =3D n > when any > when strict > ( > + of_node_put(n); > return -C; > | > of_node_put(n); > | > n1 =3D f(n,...) > | > E =3D n > | > return ...; > ) > // >=20 > Signed-off-by: Julia Lawall Acked-by: Stephen Rothwell --=20 Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ --Signature=_Mon__9_Jun_2008_23_10_37_+1000_HKYG/_Axzb=z6d7v Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkhNK80ACgkQTgG2atn1QN9GFgCfQNgpZmLlg9arSLT+Y8mCW+Xt 9KYAn0p59n2uytbhr13aoaCRdP2w2nKa =0s7l -----END PGP SIGNATURE----- --Signature=_Mon__9_Jun_2008_23_10_37_+1000_HKYG/_Axzb=z6d7v--