From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934680AbcAZPfF (ORCPT ); Tue, 26 Jan 2016 10:35:05 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:47309 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933013AbcAZPfB (ORCPT ); Tue, 26 Jan 2016 10:35:01 -0500 Date: Tue, 26 Jan 2016 15:34:54 +0000 From: Mark Brown To: Charles Keepax Cc: lgirdwood@gmail.com, linux-kernel@vger.kernel.org, patches@opensource.wolfsonmicro.com Message-ID: <20160126153454.GC6042@sirena.org.uk> References: <1453821256-28179-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="L6iaP+gRLNZHKoI4" Content-Disposition: inline In-Reply-To: <1453821256-28179-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> X-Cookie: Brain fried -- Core dumped User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH] regulator: core: Clear constraints pointer after free on error path X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --L6iaP+gRLNZHKoI4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jan 26, 2016 at 03:14:16PM +0000, Charles Keepax wrote: > As we now free the constraints in regulator_dev_release we will still > call free on the constraints pointer even if we went down an error path > in regulator_register, as such we need to clear to the pointer to ensure > the kfree in regulator_dev_release is a no-op. No, this is just making things worse - if we're doing the free in the release we should be doing the free in the release not sometimes maybey in the release. --L6iaP+gRLNZHKoI4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWp5IdAAoJECTWi3JdVIfQiHIH/2XC7FHvcJErSN46eKgt63ce G6LPakt070NaUrsLf907ttWHzFbqYofmzchmsZ81wlI2CO182ogzJa/Iol1GFvGK 5QV9dMmSnM3/tlXYVn6nsjAdBcJGmwqzF3AJWU7S0bfy6y755UYzMmbWORkLoUuv fntsevwVBUpi262uc5RpW9znAsOW6p/PVsjstmzZvgxwscgIKNcAWpx8jhNmQzK6 KKNrPBbjfn3F873rdP1wMZkdl5NsWb9SxPY5ABYnrukpY0Po1V+42UqmtI1m98vR FKTiyvMj08GEVkO1TnY2+rA5daIt4ZHpqEKJb9x/Vul1LnywqkhAHDZH3blS4eY= =pl0A -----END PGP SIGNATURE----- --L6iaP+gRLNZHKoI4--