Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2566668lkm; Mon, 20 Sep 2021 18:53:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyChorsjCnSbpM+QYAaoDqw3NuP2KgJ+htRUGJg+fRi4Aj3yu12yMIUGhiC/PASspuB48AQ X-Received: by 2002:a5e:9810:: with SMTP id s16mr5957365ioj.171.1632189221013; Mon, 20 Sep 2021 18:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632189221; cv=none; d=google.com; s=arc-20160816; b=sGGd8YdCLe+GQVHHSoQgO8lJ5tmuUWk/CnVTudKq/RkMpzzQ+5GZWem1Up+Rt6CdIV 0z2K9H8xclKuZe0iQIjLmNghQhKhOfcmgpYoP6u96WLPu1bV1lgk6WHZxkjp7YPgm9xS 2wUjh1VZRHFoZUl+5h3sRvTJmlkz442n8nJU/4eZ8f+rM1cSE39IXs0FDj48c/i+vuER n2vCCZSMDz6mIyh1+1fuawDGTPIlnkpZ+lMksNIt6aBT7fjr4aLtnENa9GLVn66cZ1nT 2aDkfYPnzPuv1Lk9rXrJE++HhGRjlcnoy1xHG7vNTcQEPeErVjz7I5k/MlqkkfSaEFH4 VIRA== 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=FD5E1gvwqThtrWi92fUh5G1k+EaIgqMjnmsb732HkKI=; b=bsOg+DvSlX7JRfGbMXtcZB8bztNzcuaZiInJ4HSutKqTnTmaTYQX13iUm6gDZcfTrH lMngMd6ZesnEm5bidR2uBxDHvc1hPGVDeovoiT3ZiEvuOednvRI0CL2kFJM8Vh0Xrk8d 6FQmX1QGEY7ZaiHsIthW8fnpgdSQExa+eE2H/Zf/toqL1yB8VFONm52j8tnygE5kUNaw VY+d6JUhcG9ol6whgjk/ry7VRhWgrqjUeWJx119nJWOfXajmrSqtUc4o8JofUJ2rpSGO Yl/aqGn77biOk0VYCzViY+V9MTQ6izjkUJZlofxmXFhG6C8Lz9yNz1cQ9rrNQHeGmegA WpHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n6AveQDh; 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 r17si13211303ilh.21.2021.09.20.18.53.30; Mon, 20 Sep 2021 18:53:41 -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=n6AveQDh; 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 S1377318AbhITSSS (ORCPT + 99 others); Mon, 20 Sep 2021 14:18:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:35786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345069AbhITSMU (ORCPT ); Mon, 20 Sep 2021 14:12:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4DE1663281; Mon, 20 Sep 2021 17:20:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158453; bh=XxpWqRYLel/LG59Qm3NLQDHNtbTcwgshYBLulKw/lvM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n6AveQDhdj8aNSs6h2DH+c4H2VaHMXyC0goDpN29pSxndCl5oT3mTo1T6wOKDRa/D pkSqjyi2LEaKVvuPftJ9hTS59JsP4XdXb/dB08kJ3J0Szv1s+Dc+U2cPv8AjdaTres Y838C7N47JBPn2FU7jgD67MEnrI9C+ebRvpXUIW8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Qilong , Luca Coelho , Sasha Levin Subject: [PATCH 5.4 164/260] iwlwifi: mvm: fix a memory leak in iwl_mvm_mac_ctxt_beacon_changed Date: Mon, 20 Sep 2021 18:43:02 +0200 Message-Id: <20210920163936.665109351@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@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: Zhang Qilong [ Upstream commit 0f5d44ac6e55551798dd3da0ff847c8df5990822 ] If beacon_inject_active is true, we will return without freeing beacon. Fid that by freeing it before returning. Signed-off-by: Zhang Qilong [reworded the commit message] Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210802172232.d16206ca60fc.I9984a9b442c84814c307cee3213044e24d26f38a@changeid Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c index 9c417dd06291..7736621dca65 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c @@ -1043,8 +1043,10 @@ int iwl_mvm_mac_ctxt_beacon_changed(struct iwl_mvm *mvm, return -ENOMEM; #ifdef CONFIG_IWLWIFI_DEBUGFS - if (mvm->beacon_inject_active) + if (mvm->beacon_inject_active) { + dev_kfree_skb(beacon); return -EBUSY; + } #endif ret = iwl_mvm_mac_ctxt_send_beacon(mvm, vif, beacon); -- 2.30.2