From patchwork Fri Mar 18 02:28:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Calaby X-Patchwork-Id: 8615891 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 49E99C0553 for ; Fri, 18 Mar 2016 02:28:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 71B7620306 for ; Fri, 18 Mar 2016 02:28:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9AFE720160 for ; Fri, 18 Mar 2016 02:28:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752708AbcCRC2r (ORCPT ); Thu, 17 Mar 2016 22:28:47 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:36090 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752676AbcCRC2l (ORCPT ); Thu, 17 Mar 2016 22:28:41 -0400 Received: by mail-pf0-f169.google.com with SMTP id u190so146281712pfb.3 for ; Thu, 17 Mar 2016 19:28:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Sm9RF152nfc9XzjitUgmfdnIrKiCj3HpQNZSoGImb60=; b=oesPg8qUjYBn9kp1x5n8FBSN9rJ6Hf6gZpCUMfJesmDg6hulhWAfKjXkFYr4dVzedo rZ5tAwNbj2DYdqZqM83u9EwfWYqo7ouHYV7ALCwNO3n6Q8ISAfvIx65iSCSZ1n9io7ST rpptsu0INyRUbE1HjDLLGFTVyeZ7sHWNyKmpKOidW5cMOkvKCIMehppV4gnq6QVHttE5 IB0cBjY10stQ528IyGF+LRGoYL1FuQ5+iCvxv6nZYWuxS0iWY7qksODtefLBZoSKV/af EKJDAoda+NNO/tp5U2VT+fUGzfI2NeCjMFNWm/3PZ9xHWQaZ8sRzep0FWrzwF1ZdukMC Ht8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Sm9RF152nfc9XzjitUgmfdnIrKiCj3HpQNZSoGImb60=; b=d0rTnciTsy4zs5FN64+tDFk7oPnJy4qsm4tRywMfQ2anb5Uv6SJ9JzI2yDXrjF4tBE KHlabOwAAMXmfiTuI4i3XRxFrzij0aGNKzK2ybJHUPpppTKrTabFKyBbadnSgUilMTQk W4Qsu/nDkvi0knq09RQMnncYSle5HBRBzw+RcifP/gZGpoZhAvQWphgR7x/FJX4ZwarV W1jaZ0b5+cqF89tZg+FLrsD7wbjUooBwHTYRexvllTNKePHMkq5/oiSt1W2kfkUxOvv6 SQYQ6eYXeLpajFcLQRbXrXCfKmFa6/D6I6c6b8yVXFF8+hARs67LSbrJJ6mYiNtsISCQ yFaA== X-Gm-Message-State: AD7BkJLQjTKMVgj5vRWMG3Kfmgz5pWmglgLppCNMJkb04I1LmQOTvWe3toIRBfvDN5zC6w== X-Received: by 10.98.69.84 with SMTP id s81mr19640278pfa.125.1458268119961; Thu, 17 Mar 2016 19:28:39 -0700 (PDT) Received: from multimedia.lan (C-59-101-14-180.hay.connect.net.au. [59.101.14.180]) by smtp.gmail.com with ESMTPSA id n68sm16398509pfj.46.2016.03.17.19.28.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Mar 2016 19:28:39 -0700 (PDT) From: Julian Calaby To: Kalle Valo Cc: Stanislaw Gruszka , Johannes Berg , Jia-Ju Bai , Sara Sharon , Emmanuel Grumbach , linux-wireless@vger.kernel.org Subject: [PATCH MOREWORK 17/19] iwl4965: Fix a memory leak in error handling code of __il4965_up Date: Fri, 18 Mar 2016 13:28:33 +1100 Message-Id: <3aaac3629455d27b0e9c56ef1615b89873b1b8cf.1458262312.git.julian.calaby@gmail.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: References: 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_ADSP_CUSTOM_MED, 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 From: Jia-Ju Bai 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 Signed-off-by: Julian Calaby --- drivers/net/wireless/intel/iwlegacy/4965-mac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c index b75f4ef..30d9dd3 100644 --- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/intel/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; }