From patchwork Sun Jan 10 02:19:23 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: 7993941 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 BCC00BEEE5 for ; Sun, 10 Jan 2016 02:20:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E58B720259 for ; Sun, 10 Jan 2016 02:20:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 13C9720204 for ; Sun, 10 Jan 2016 02:20:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756777AbcAJCT5 (ORCPT ); Sat, 9 Jan 2016 21:19:57 -0500 Received: from m12-16.163.com ([220.181.12.16]:44639 "EHLO m12-16.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756634AbcAJCT0 (ORCPT ); Sat, 9 Jan 2016 21:19:26 -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=Ddp4h3DMQP4PgpboNqifH1UHLZiE5JO1Bv ljtC4jsQHqGruyvx/FAcJ5CoGQAY6B8jwvNUNyJGtXAsjRv9bbMEI59zWv4M08z9 szuT00iUoxQbqxfzVjViq75G351eKKerCHaUuoPdIm7yyl60xmJswJL5VwTyWBpR 6NlVddUFE= Received: from bai-oslab.tsinghua.edu.cn (unknown [166.111.70.16]) by smtp12 (Coremail) with SMTP id EMCowECJoEOZv5FW3kU7AA--.16006S2; Sun, 10 Jan 2016 10:19:08 +0800 (CST) From: Jia-Ju Bai To: sgruszka@redhat.com, kvalo@codeaurora.org, johannes.berg@intel.com, emmanuel.grumbach@intel.com Cc: ilw@linux.intel.com, linuxwifi@intel.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] iwl4965: Fix a memory leak in error handling code of __il4965_up Date: Sun, 10 Jan 2016 10:19:23 +0800 Message-Id: <1452392363-3600-1-git-send-email-baijiaju1990@163.com> X-Mailer: git-send-email 1.7.9.5 X-CM-TRANSID: EMCowECJoEOZv5FW3kU7AA--.16006S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Xr1fCF1kGF48tF15WFyDJrb_yoWfZrc_G3 4IgFn29ryFkr4093W29FsxAryay3y3XFnYka9rta4Yv345JrW5AF909rZ3Z39rWr4fZa43 GrnxXFW8Jw1FqjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUjpBT7UUUUU== X-Originating-IP: [166.111.70.16] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/xtbBRRzrelO-zitN9QAAs5 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 --- 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; }