From patchwork Wed Aug 1 20:35:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 1265941 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id E95CFDF215 for ; Wed, 1 Aug 2012 21:55:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755992Ab2HAVzs (ORCPT ); Wed, 1 Aug 2012 17:55:48 -0400 Received: from queueout02-winn.ispmail.ntl.com ([81.103.221.56]:60909 "EHLO queueout02-winn.ispmail.ntl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753778Ab2HAVzs (ORCPT ); Wed, 1 Aug 2012 17:55:48 -0400 X-Greylist: delayed 4797 seconds by postgrey-1.27 at vger.kernel.org; Wed, 01 Aug 2012 17:55:47 EDT Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20120801203539.GTKZ26256.mtaout03-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com>; Wed, 1 Aug 2012 21:35:39 +0100 Received: from zog.reactivated.net ([86.14.215.141]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.3.00.04.00 201-2196-133-20080908) with ESMTP id <20120801203539.BHKI8396.aamtaout01-winn.ispmail.ntl.com@zog.reactivated.net>; Wed, 1 Aug 2012 21:35:39 +0100 Received: by zog.reactivated.net (Postfix, from userid 1000) id C81E39D401E; Wed, 1 Aug 2012 21:35:36 +0100 (BST) From: Daniel Drake To: linville@tuxdriver.com Cc: dcbw@redhat.com, linux-wireless@vger.kernel.org, libertas-dev@lists.infradead.org Subject: [PATCH] libertas: fix two memory leaks Message-Id: <20120801203536.C81E39D401E@zog.reactivated.net> Date: Wed, 1 Aug 2012 21:35:36 +0100 (BST) X-Cloudmark-Analysis: v=1.1 cv=GaEGOwq9FwezmTggA+b6yC6zDZF2HYaK6RN/tSqdnVA= c=1 sm=0 a=3QB82-DyWkIA:10 a=vJ1w_8FsMGIA:10 a=Op-mwl0xAAAA:8 a=qtN_FUMYRE5aAuDor78A:9 a=d4CUUju0HPYA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The if_sdio_card structure was never being freed, and neither was the command structure used for association. Signed-off-by: Daniel Drake --- drivers/net/wireless/libertas/cfg.c | 1 + drivers/net/wireless/libertas/if_sdio.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c index eb5de80..1c10b54 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c @@ -1254,6 +1254,7 @@ static int lbs_associate(struct lbs_private *priv, netif_tx_wake_all_queues(priv->dev); } + kfree(cmd); done: lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret); return ret; diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index 76caeba..e970897 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c @@ -1314,6 +1314,7 @@ static void if_sdio_remove(struct sdio_func *func) kfree(packet); } + kfree(card); lbs_deb_leave(LBS_DEB_SDIO); }