Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753048Ab2EFDNk (ORCPT ); Sat, 5 May 2012 23:13:40 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:49909 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751110Ab2EFDNj (ORCPT ); Sat, 5 May 2012 23:13:39 -0400 Date: Sat, 5 May 2012 20:12:12 -0700 From: Anton Vorontsov To: Marek Vasut Cc: Jesper Juhl , linux-kernel@vger.kernel.org, Felipe Contreras , Felipe Balbi , Heikki Krogerus , Kalle Jokiniemi Subject: Re: [PATCH] ISP1704 USB Charger: Fix use-after-free error in isp1704_charger_probe() Message-ID: <20120506031212.GF29576@lizard> References: <201204222234.59624.marex@denx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201204222234.59624.marex@denx.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 676 Lines: 24 On Sun, Apr 22, 2012 at 10:34:59PM +0200, Marek Vasut wrote: [...] > > - > > dev_err(&pdev->dev, "failed to register isp1704 with error %d\n", ret); > > - > > isp1704_charger_set_power(isp, 0); > > + kfree(isp); Dan Carpenter sent a similar fix ~month ago, so it's in already. > Use devm_kzalloc() and be done with all this goo? Yeah, that's actually a good idea. Thanks, -- Anton Vorontsov Email: cbouatmailru@gmail.com -- 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/