Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp632039pxv; Thu, 15 Jul 2021 12:01:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynbpIpPielxtsiahL97msLqYWHYWAMYfH2+nHKqej5/J4aF1K9NiD8QgOZ0viqdGK4Y8gt X-Received: by 2002:a17:906:c1da:: with SMTP id bw26mr7086206ejb.253.1626375696060; Thu, 15 Jul 2021 12:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626375696; cv=none; d=google.com; s=arc-20160816; b=xnxAp6rrmOAUIKbkX6wx0HHVLmBdjek0l6wj5l4gvZrRb28XTtBa5r35/+nfVDT8Q3 +MgL+aB6qZkM/2UWbioiMraOGfDq7TW0EcDZkn0cTuttSwTCEf6iCvutsUfN9BjezSng Tcm58O4bQsJFBHLaWRmUWvdAzaMB4p+JY8s7GnTfU+lSxRSzEbXNFhvK6JIThVWWHl2/ XSAPDfhlvyLuMvLfMAJ1xo4Dz4LyvMWb6hkKfBdPuMTmYuNf0MLFLQQBVVtzpdIMfCKH 6dXOOFlQP+7XjwjyM05wYXr+WlQ+NmlaNbIFRZiO4W1Kkg0QOcbPUp6mgNqikA6vKDtS zUtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u4PiTkM65BqO5N44XLX7bolQ9YA6DsXKZI9aq3Ln7X0=; b=qThn+pIBfhVFnKY0kzCp7t9bEP/d1lbYrm10feSzj5YSlvaL0Sy2IHW02QR95JRZR3 C1tt3l1EU/h7JtC2mCBUtY82ojZvTXJtSknfLwDoRpoj0Gk985mMmC74pmqMu5c0+/xI TXGtbL++ONuykZTx0kfAgL/OwmukBVUYSD6Fn24BS9grS5KBrC2j0Qxm5200+p+aLVC9 P2+wDVZj/pVXdsKE2h0wSnIRbwplGIemkD1A3xZIv3zqZ3pCeuM2gYnYGdEFhL7R43qF T0EfpH+g0nZh9FtOPC7HzrdNT08JlILJcFTXTk/UwNLT/BeqsBTm9U0kB34FtGo1OIpP HJWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FRW3sU5l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zm10si8230413ejb.633.2021.07.15.12.01.11; Thu, 15 Jul 2021 12:01:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FRW3sU5l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242481AbhGOTCY (ORCPT + 99 others); Thu, 15 Jul 2021 15:02:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:58678 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241160AbhGOSyG (ORCPT ); Thu, 15 Jul 2021 14:54:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 73D6A613D7; Thu, 15 Jul 2021 18:51:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375071; bh=Jt/aDsq1Stl07LbDBGnFnJezfY3j/6id96MaEfUjrqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FRW3sU5lQt8z6sC81oU5Qn76jJnAhLnVqdu3WUjtO2x52IN7upWJ1mGtzbg5Ut2pX 1PRywsD/xPpKE8vCJQSkRTWSBYQJpA8NVu4utj5Pm/rT4lli8dcktOi+T6hJF5oYeM SVq6/qQeCw6yOB4i1Dk9h/94DwveFFfCFXtDwnEI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg , Luca Coelho , Sasha Levin Subject: [PATCH 5.10 105/215] iwlwifi: pcie: fix context info freeing Date: Thu, 15 Jul 2021 20:37:57 +0200 Message-Id: <20210715182617.939392544@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182558.381078833@linuxfoundation.org> References: <20210715182558.381078833@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg [ Upstream commit 26d18c75a7496c4c52b0b6789e713dc76ebfbc87 ] After firmware alive, iwl_trans_pcie_gen2_fw_alive() is called to free the context info. However, on gen3 that will then free the context info with the wrong size. Since we free this allocation later, let it stick around until the device is stopped for now, freeing some of it earlier is a separate change. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210618105614.afb63fb8cbc1.If4968db8e09f4ce2a1d27a6d750bca3d132d7d70@changeid Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c index 4c3ca2a37696..b031e9304983 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c @@ -269,7 +269,8 @@ void iwl_trans_pcie_gen2_fw_alive(struct iwl_trans *trans, u32 scd_addr) /* now that we got alive we can free the fw image & the context info. * paging memory cannot be freed included since FW will still use it */ - iwl_pcie_ctxt_info_free(trans); + if (trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210) + iwl_pcie_ctxt_info_free(trans); /* * Re-enable all the interrupts, including the RF-Kill one, now that -- 2.30.2