From patchwork Thu Jan 7 12:17:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 7976481 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 93C5EBEEE5 for ; Thu, 7 Jan 2016 12:17:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC26F2015E for ; Thu, 7 Jan 2016 12:17:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF1C32014A for ; Thu, 7 Jan 2016 12:17:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752697AbcAGMRn (ORCPT ); Thu, 7 Jan 2016 07:17:43 -0500 Received: from m12-18.163.com ([220.181.12.18]:50754 "EHLO m12-18.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752018AbcAGMRl (ORCPT ); Thu, 7 Jan 2016 07:17:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=4OJd13stwla42+DSVw GCA7iP9MzR44G1O8+GfNwgAbo=; b=kt3PJAqhmggxiwyRjOxoBEhpDLHlMCUFYx Hg8OyAOYbKvY3X9Y2qU3raFPAf+Gqd1RaZ6ATSC/Nx21fVkR8iAgUnvpyUudXKQd QAAJn4wmpBf9S/3E6vYFiRPtcOQCFjAISU8iAhdTBh2EiULqFIHXT2SRrAehIIpw zbYJ7YbFo= Received: from bai-oslab.tsinghua.edu.cn (unknown [166.111.70.58]) by smtp14 (Coremail) with SMTP id EsCowECp1UdXV45W9gcdAA--.7106S2; Thu, 07 Jan 2016 20:17:31 +0800 (CST) From: Jia-Ju Bai To: sgruszka@redhat.com, kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] iwl4965: Fix a memory leak in error handling code of __il4965_up Date: Thu, 7 Jan 2016 20:17:39 +0800 Message-Id: <1452169059-20617-1-git-send-email-baijiaju1990@163.com> X-Mailer: git-send-email 1.7.9.5 X-CM-TRANSID: EsCowECp1UdXV45W9gcdAA--.7106S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Xr1fCF1kGF48tF15WFyDJrb_yoWfZrc_G3 4IgFn29ryFkr4093W29FsxAryay3y3XFnYka9rta4Yv345JrW5AF909rZ3Z39rWr4fZa43 GrnxXFW8Jw1FqjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUbKFAtUUUUU== X-Originating-IP: [166.111.70.58] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/1tbiThvoelUCqSUSKAAAsm Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When il4965_hw_nic_init in __il4965_up fails, the memory allocated by iwl4965_sta_alloc_lq in iwl4965_alloc_bcast_station is not freed. This patches adds il_dealloc_bcast_stations in the error handling code of __il4965_up to fix this problem. This patch has been tested in real device, and it actually fixes the bug. Signed-off-by: Jia-Ju Bai Acked-by: Stanislaw Gruszka --- drivers/net/wireless/iwlegacy/4965-mac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c index 6656215..fd7b5c7 100644 --- a/drivers/net/wireless/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/iwlegacy/4965-mac.c @@ -5577,6 +5577,7 @@ __il4965_up(struct il_priv *il) ret = il4965_hw_nic_init(il); if (ret) { IL_ERR("Unable to init nic\n"); + il_dealloc_bcast_stations(il); return ret; }