Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2291144pxb; Thu, 11 Feb 2021 08:47:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1jc3QAQkCxOg2ryEWFtqvTMgVlCyP1DYun13buoCK8J7hagy3m0782yyr8Eubx+2u3r86 X-Received: by 2002:a17:906:6d94:: with SMTP id h20mr9456223ejt.231.1613062068071; Thu, 11 Feb 2021 08:47:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613062068; cv=none; d=google.com; s=arc-20160816; b=hE5DWvRUAj0KtAufsR6OMMvS0e/EWUSR3uMojZvAKbk2iPLxSoif5yy/bG3pc6ilVE V9/kTpLauDZ6rTCkaG1nv2qIPgrfX3MCeo2d69u64Se38Gsln2zvGqR4AO5WsbIFvaRf yc7yy+nnlsZcCTGEnxKtlG2VatzluQKH0ywMxNkVoZjFgubg3zIFyosgsCJKO38thWhI qfMxkxdqAbUAB82CuWzIp4rtWS7VeOnMCfVK53hhHc+hCSrRGHmG/OfZ4WaBOafrrrzO W7gkT253SKbExZqdwj0Fm5HRMkxmKDkdUvKExXfjej0DihhQcCUZpCVkhCadYJBaeWPW 4Z9A== 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=/UMeijyEbvuo+efJi/zyKmIAfCTkeyskc+xEDDHhuzE=; b=ysDhSFuYfzlyohsCaoSrU6JE2gcu7xGcSWJLugiBtjC0v5fzexSyaLeVl0xwMlzzfO 07G1JTTYrXzjZS3jzBLOmL3wdeItEZ3HpdSdtF5guEeoxC9at4jATH0/965o6qCuIrE6 EXWjx7WCqpADejMpLT2R7qh+GBBl6pbMuChsfpDmFndV7OjcZ/jc48eAU4fxOr8/Na8+ iM0EVVih6Mexl2R4YgdzHnsWx02Fj7iasbJAJ9Z2R1jshDizcjV2uXRGVP4iC/HCkugj WStGrpo8h+PZmnXNIu5IbrRE8T3TAOJuoA+4ZUdnV338355Dl37F/+MPgaAR6HqKAHh0 KyBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p5cOwd0C; 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 w4si3863154ejz.337.2021.02.11.08.47.24; Thu, 11 Feb 2021 08:47:48 -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=p5cOwd0C; 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 S231363AbhBKQp4 (ORCPT + 99 others); Thu, 11 Feb 2021 11:45:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:57046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231372AbhBKPhA (ORCPT ); Thu, 11 Feb 2021 10:37:00 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id F343464F04; Thu, 11 Feb 2021 15:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613055923; bh=cLcsa51PyK+Y+1DrJUenXnA+a2UDeaAi47p99Do7Sq8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p5cOwd0C3qmDESReSDdqM/qgsG2/so7m2xTONeGFXmKD7rkX3le4K/FM+VGkl17ql bYpxKJE6nELiJslxtBBjLdASaOP9qr2C2xabxrIY3mSNHG0NHEmPOI46tXmEYEkaq9 JHkmDz5XiNMp9mrIevY15OaxbytUnAa3H/Uffn/Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg , Luca Coelho , Kalle Valo , Sasha Levin Subject: [PATCH 5.10 38/54] iwlwifi: queue: bail out on invalid freeing Date: Thu, 11 Feb 2021 16:02:22 +0100 Message-Id: <20210211150154.536382640@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: Johannes Berg [ Upstream commit 0bed6a2a14afaae240cc431e49c260568488b51c ] If we find an entry without an SKB, we currently continue, but that will just result in an infinite loop since we won't increment the read pointer, and will try the same thing over and over again. Fix this. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20210122144849.abe2dedcc3ac.Ia6b03f9eeb617fd819e56dd5376f4bb8edc7b98a@changeid Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/queue/tx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/queue/tx.c b/drivers/net/wireless/intel/iwlwifi/queue/tx.c index af0b27a68d84d..9181221a2434d 100644 --- a/drivers/net/wireless/intel/iwlwifi/queue/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/queue/tx.c @@ -887,10 +887,8 @@ void iwl_txq_gen2_unmap(struct iwl_trans *trans, int txq_id) int idx = iwl_txq_get_cmd_index(txq, txq->read_ptr); struct sk_buff *skb = txq->entries[idx].skb; - if (WARN_ON_ONCE(!skb)) - continue; - - iwl_txq_free_tso_page(trans, skb); + if (!WARN_ON_ONCE(!skb)) + iwl_txq_free_tso_page(trans, skb); } iwl_txq_gen2_free_tfd(trans, txq); txq->read_ptr = iwl_txq_inc_wrap(trans, txq->read_ptr); -- 2.27.0