Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753055AbZDZExq (ORCPT ); Sun, 26 Apr 2009 00:53:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750957AbZDZExh (ORCPT ); Sun, 26 Apr 2009 00:53:37 -0400 Received: from utopia.booyaka.com ([72.9.107.138]:55955 "EHLO utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750831AbZDZExg (ORCPT ); Sun, 26 Apr 2009 00:53:36 -0400 Date: Sat, 25 Apr 2009 22:53:35 -0600 (MDT) From: Paul Walmsley To: linux-omap@vger.kernel.org cc: lrg@slimlogic.co.uk, broonie@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org, dbrownell@users.sourceforge.net Subject: Re: [PATCH] regulator core: fix double-free in regulator_register() error path In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 844 Lines: 22 On Sat, 25 Apr 2009, Paul Walmsley wrote: > During regulator registration, any error after device_register() will > cause a double-free on the struct regulator_dev 'rdev'. The bug is in > drivers/regulator/core.c:regulator_register(): > > ... > > device_unregister() calls regulator_dev_release() which frees rdev. The > subsequent kfree corrupts memory and causes some OMAP3 systems to oops on > boot in regulator_get(). For the 3430SDP users out there, this patch also fixes the boot hang after "regulator_init_complete: incomplete constraints, leaving VAUX3 on" on that device. - Paul -- 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/