From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966462AbcAZP5f (ORCPT ); Tue, 26 Jan 2016 10:57:35 -0500 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:37189 "EHLO mx0a-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934668AbcAZP5d (ORCPT ); Tue, 26 Jan 2016 10:57:33 -0500 Authentication-Results: ppops.net; spf=none smtp.mail=ckeepax@opensource.wolfsonmicro.com Date: Tue, 26 Jan 2016 15:57:32 +0000 From: Charles Keepax To: Mark Brown CC: , , Subject: Re: [PATCH] regulator: core: Clear constraints pointer after free on error path Message-ID: <20160126155732.GM1490@localhost.localdomain> References: <1453821256-28179-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> <20160126153454.GC6042@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20160126153454.GC6042@sirena.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310008 definitions=main-1601260279 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 26, 2016 at 03:34:54PM +0000, Mark Brown wrote: > 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. Fair enough I will respin to remove the other free's. Thanks, Charles