From patchwork Tue Jun 29 22:18:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tilman Schmidt X-Patchwork-Id: 57328 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 251FF1007D1 for ; Wed, 30 Jun 2010 08:18:35 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756420Ab0F2WSa (ORCPT ); Tue, 29 Jun 2010 18:18:30 -0400 Received: from out1.smtp.messagingengine.com ([66.111.4.25]:58640 "EHLO out1.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756403Ab0F2WS3 (ORCPT ); Tue, 29 Jun 2010 18:18:29 -0400 Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 316BB10771D; Tue, 29 Jun 2010 18:18:29 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Tue, 29 Jun 2010 18:18:29 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:cc:subject:references:in-reply-to:content-type; s=smtpout; bh=v+IRic00rarVmVRnywSPQgjdrIM=; b=FJTijLRToNDeObtrUmIbBJO+Gd8hfigaPofbGLAI5gOkNGU7UGl4ypym1JqGajnzygywcHJzEskYLHzPpNSzNXTc2w6VkHGJndNAOMPaubYzAA7Ay/EtFMQF5t13IFlEK8zJ9DA1YTARBB74S55gv1daCzY40HyUVsWdcPBRObo= X-Sasl-enc: 60ZSFzJiw3nW9Cz9GppmlP19uXt9rP75Y9pNJiDtDRe7 1277849908 Received: from [192.168.59.102] (pD9E84160.dip.t-dialin.net [217.232.65.96]) by mail.messagingengine.com (Postfix) with ESMTPSA id A233E6A79A; Tue, 29 Jun 2010 18:18:27 -0400 (EDT) Message-ID: <4C2A7127.3040609@imap.cc> Date: Wed, 30 Jun 2010 00:18:15 +0200 From: Tilman Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.9) Gecko/20100317 SUSE/3.0.4-1.1.1 Thunderbird/3.0.4 MIME-Version: 1.0 To: Dan Carpenter CC: Hansjoerg Lipp , Karsten Keil , "David S. Miller" , gigaset307x-common@lists.sourceforge.net, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [patch] isdn/gigaset: add a kfree() to error path References: <20100628212046.GM19184@bicker> In-Reply-To: <20100628212046.GM19184@bicker> X-Enigmail-Version: 1.0.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Dan, thanks for your patch. It is quite correct as it stands. There is however another problem with that error path, in that it also doesn't free the previously allocated channel. I prefer not to carry two separate patches for that, so I'm replacing your patch with the following augmented patch, which I'll submit together with my other pending patches for 2.6.36 soon: Subject: [PATCH] isdn/gigaset: fix leaks in error path Take care to free all previously allocated ressources in the "out of memory" error path of the ISDN_CMD_DIAL branch. Based on an original patch by Dan Carpenter. Impact: bugfix Reported-by: Dan Carpenter Signed-off-by: Tilman Schmidt Acked-by: Dan Carpenter --- drivers/isdn/gigaset/i4l.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c index 1d084bb..34bca37 100644 --- a/drivers/isdn/gigaset/i4l.c +++ b/drivers/isdn/gigaset/i4l.c @@ -419,6 +419,8 @@ oom: dev_err(bcs->cs->dev, "out of memory\n"); for (i = 0; i < AT_NUM; ++i) kfree(commands[i]); + kfree(commands); + gigaset_free_channel(bcs); return -ENOMEM; }