From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753609AbbGOL2C (ORCPT ); Wed, 15 Jul 2015 07:28:02 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:52482 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751952AbbGOL2A (ORCPT ); Wed, 15 Jul 2015 07:28:00 -0400 Date: Wed, 15 Jul 2015 12:27:30 +0100 From: Mark Brown To: Javier Martinez Canillas Cc: Krzysztof Kozlowski , Liam Girdwood , linux-kernel@vger.kernel.org Message-ID: <20150715112730.GN11162@sirena.org.uk> References: <1436883709-9337-1-git-send-email-javier@osg.samsung.com> <55A61C0E.4040707@osg.samsung.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aEj7SNOwuMqsAi92" Content-Disposition: inline In-Reply-To: <55A61C0E.4040707@osg.samsung.com> X-Cookie: Stay together, drag each other down. User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH] regulator: core: Fix memory leak in regulator_resolve_supply() 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 --aEj7SNOwuMqsAi92 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jul 15, 2015 at 10:38:38AM +0200, Javier Martinez Canillas wrote: > On 07/15/2015 10:01 AM, Krzysztof Kozlowski wrote: > > The _regulator_put() reverts more work than create_regulator() did, > > e.g.: module_put and rdev->open_count--. Maybe you need a > > destroy_regulator() function? > Yes, it reverts more work than create_regulator() but the intention is to > revert what set_supply() did. If you look at the set_supply() function, > it does supply_rdev->open_count++. > I did indeed missed the module_put() but now looking at the code again, I Me too, I've dropped the patch. At first glance everything looked safe for multiple calls. > wonder if the problem is not that set_supply() is missing a try_module_get() > to be consistent with what the _regulator_get() function does. The problem is more that it's a separate implementation and not just using _regulator_get() I think. A separate, rarely used, path is likely to have this sort of issue. --aEj7SNOwuMqsAi92 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVpkOhAAoJECTWi3JdVIfQU8sH/25Eq3y25rjkMKIPbv+oNRAn LvJ8nBLYQR72GqhMQlqpZ0Ih0zyAXbjoQ2PuyHPEy63LYZ1bzGbQIFWSlq/eYL7s w8R4/y4j6dO873ZvuInw6u/ESgPU/VkVDAodi7HHfVbh/e2rkKyehmqLpy6OXney 3OV6lzvlZrUk+HSPtdjU2FISXiHn+vyNHm907mRx0P18FQZsZKFyaZycSvYWvIe9 13O4AC1/chOJGzXO3CN7007jA7SAi6AFEfS5z9NVK+AHvJo7bl1FrRfuaDAuxLZL KzTiZ0knMJ69XJl5nK/Xp/KDAlddTbHfewzLaoZhjSBpwej394ybxSPk53gTP5g= =t+uq -----END PGP SIGNATURE----- --aEj7SNOwuMqsAi92--