From patchwork Tue Apr 26 08:43:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 8936171 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2B8ED9F441 for ; Tue, 26 Apr 2016 08:43:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58CAE201BB for ; Tue, 26 Apr 2016 08:43:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5672D20172 for ; Tue, 26 Apr 2016 08:43:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752453AbcDZInz (ORCPT ); Tue, 26 Apr 2016 04:43:55 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:14993 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752344AbcDZInx (ORCPT ); Tue, 26 Apr 2016 04:43:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1461660233; x=1493196233; h=from:to:cc:subject:date:message-id:mime-version; bh=EV3sJFsy3NLuHKq6rY2sQMey8ERiunA0NdC9lPvT0Kk=; b=zKhpm/6lAw4qmD1pjXekXhkrcWIghU/MyOlLybLWHd5sWhc+s/Ewgc1i 48XMwwa/Ny21InwNRA1F5zlB6VKgb4N/9wBeEzsk/vnO+N4aK8KREMA0c rDnvLfFBSZGBvP9jmTb3Up7B8Qdyf4iTw7swX1F42Iysk6Cjv47Oz0ehp M=; X-IronPort-AV: E=Sophos;i="5.24,536,1455004800"; d="scan'208";a="283408208" Received: from ironmsg02-l-new.qualcomm.com (HELO ironmsg02-L.qualcomm.com) ([10.53.140.109]) by wolverine02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 26 Apr 2016 01:43:52 -0700 X-IronPort-AV: E=McAfee;i="5700,7163,8146"; a="684356407" Received: from nasanexm01c.na.qualcomm.com ([10.85.0.83]) by ironmsg02-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 26 Apr 2016 01:43:52 -0700 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by NASANEXM01C.na.qualcomm.com (10.85.0.83) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Tue, 26 Apr 2016 01:43:51 -0700 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01b.ap.qualcomm.com (10.252.127.11) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Tue, 26 Apr 2016 14:13:42 +0530 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Tue, 26 Apr 2016 14:13:37 +0530 From: Rajkumar Manoharan To: CC: , , "Rajkumar Manoharan" Subject: [PATCH] ath10k: release pre_cal_file while unloading driver Date: Tue, 26 Apr 2016 14:13:37 +0530 Message-ID: <1461660217-23046-1-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.8.0 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) To aphydexm01b.ap.qualcomm.com (10.252.127.11) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 Failing to release pre_cal_file caldata on deinit causes memory leak. Fixes: b131129d9657 ("ath10k: fix calibration init sequence of qca99x0") Signed-off-by: Rajkumar Manoharan --- drivers/net/wireless/ath/ath10k/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 5f846bd4054c..6e37184abab6 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -712,6 +712,9 @@ static void ath10k_core_free_firmware_files(struct ath10k *ar) if (!IS_ERR(ar->cal_file)) release_firmware(ar->cal_file); + if (!IS_ERR(ar->pre_cal_file)) + release_firmware(ar->pre_cal_file); + ath10k_swap_code_seg_release(ar); ar->otp = NULL; @@ -723,6 +726,7 @@ static void ath10k_core_free_firmware_files(struct ath10k *ar) ar->firmware_len = 0; ar->cal_file = NULL; + ar->pre_cal_file = NULL; } static int ath10k_fetch_cal_file(struct ath10k *ar)