Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2291747pxb; Thu, 11 Feb 2021 08:48:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJwjtWLLbFq1cKDmWqW0owDoojI3SDs/o2SktopVaCOyJsMc8ZVfI72DSaceJwQRp9aGu8mg X-Received: by 2002:a05:6402:402:: with SMTP id q2mr9219161edv.116.1613062116333; Thu, 11 Feb 2021 08:48:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613062116; cv=none; d=google.com; s=arc-20160816; b=DYzLjbA0kwKYekXFAYB2voEt2udMVp3IQ7P5cCdu6H401O/C059fY491iX9TrAmFc4 mFVZK39s5HiUEI0oNO/e8+rmwFprqOYaDqCFeBg6n+Tc/5TG51LjFpqOB16vTmimS/rX 73rGYH8KhE+tcNhM/tuPlmtnWMmzfrjG3p/6tf7Fcw6a8g5qz0lUOwABKHwljfTYwRK7 tBEniZ0grhj0s8YSGNh50ZLdsJ6W9bgec5EqahLRWQ1bMhwpOxwoIdHEyVN+M3/OwTLo fT29CJ4I36ER/T5CVEQsbInihSgEtQ5BeXD9l1S53Zow0Arex9fbONB6LfYYduNAkyDn Li0A== 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=q6UzxVrD1XLoJbWsdSquTz9M4GUXljERRFve281dzpE=; b=Uh70drn+qc2WjcOPwSyV/1Q5sMug8x/scNp9D41CJLdnAGaCElGz7j2a8IyWVL0gaP 0M26NCn8aVkdzckNP4y2rTRK1vX+ncpMclzneuzc2SJWwgDgZcsWovOE/742HY7obTum PyEqmN/BqSCafNoATj6K02C1Yibtmx0wKv46XjH9hgBgT0IwbmmKrcdsksK5VoFFKbAQ JyuBI5zUUJLKMKXPGH2ESgHLJzvYP1vX/jF/HmQYWjGkF5vNbi+G05ahS33+/4txvaGv +MJUSqX9TuSr6qqghowoyeieHm0mA5mNWOnkknk0rm3HiNCdneFT1nWvnWSBkOtFRGQy qnsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=djsmI0yb; 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 h20si3881543ejy.576.2021.02.11.08.48.11; Thu, 11 Feb 2021 08:48:36 -0800 (PST) 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=djsmI0yb; 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 S232047AbhBKQou (ORCPT + 99 others); Thu, 11 Feb 2021 11:44:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:57040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231347AbhBKPhA (ORCPT ); Thu, 11 Feb 2021 10:37:00 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 864BD64EFD; Thu, 11 Feb 2021 15:05:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613055911; bh=Mntyyw9pDo73Mx8hzXtsDcqsj83PlObc6cNFP+pQy/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=djsmI0ybpiUD0wnt8J/nZT9C0YfnFxIuyCFe2EW6WEb3OIEbtZndyqVKVQP7hxuxf Wjm3vsWg/OGUwoeoi/dL4fDaMi8HzDfQFr/EHIpfap44eZg/7RYzuwBeCdUgMFD+T0 dCHEFkXKs0v6UtnrVpLLY+J4AyaaRos/0fOfBBAA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Emmanuel Grumbach , Luca Coelho , Kalle Valo , Sasha Levin Subject: [PATCH 5.10 33/54] iwlwifi: pcie: add a NULL check in iwl_pcie_txq_unmap Date: Thu, 11 Feb 2021 16:02:17 +0100 Message-Id: <20210211150154.329490410@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210211150152.885701259@linuxfoundation.org> References: <20210211150152.885701259@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: Emmanuel Grumbach [ Upstream commit 98c7d21f957b10d9c07a3a60a3a5a8f326a197e5 ] I hit a NULL pointer exception in this function when the init flow went really bad. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20210115130252.2e8da9f2c132.I0234d4b8ddaf70aaa5028a20c863255e05bc1f84@changeid Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c index 966be5689d63a..ed54d04e43964 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c @@ -299,6 +299,11 @@ static void iwl_pcie_txq_unmap(struct iwl_trans *trans, int txq_id) struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); struct iwl_txq *txq = trans->txqs.txq[txq_id]; + if (!txq) { + IWL_ERR(trans, "Trying to free a queue that wasn't allocated?\n"); + return; + } + spin_lock_bh(&txq->lock); while (txq->write_ptr != txq->read_ptr) { IWL_DEBUG_TX_REPLY(trans, "Q %d Free %d\n", -- 2.27.0