Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1540835pxb; Thu, 16 Sep 2021 09:32:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzitUEMMC9F6kfBfZxDLf3vjdXLxW9dEvBBim5Lb/fCpMFaDgFKad/4TqytnS7m/lAwjZDS X-Received: by 2002:a02:3202:: with SMTP id j2mr5064430jaa.125.1631809939209; Thu, 16 Sep 2021 09:32:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631809939; cv=none; d=google.com; s=arc-20160816; b=hnN771oJPhHEisd5Ezp12demwlAoDkUzcWq6a9OHUg4aVumxK1rEU2hU2oNU/8aXqQ oAfIMrQZYkAqYrGOYxTPNvZ+PuqdYpnsVl8SkpUg+W1VS2nDs3bGW+EKbQVKcRlI6pp6 7aCzkw0cxisQoCVVORICunmbe30RbiQhLZ80q7PfPLiPzvyq/8qIn65PORdk0czmXP6c C4vlerYL/wvFsrGUf2OfRTu5odMruw1eGej8KpKTfVHS0CrAdzPQS9MbdEoc5+RfQZh4 4DAzp19gZ7UfMVVeAzFlrUj8XFyYjN81LRcVIGmAO9Arop3BgjdSFwzir0PxuEJoWnbh XfeA== 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=5NqS3yAAoE8/7hvz5mLjiuuTHo1nxShT/oREfDe/wI4=; b=PujpjJt1rAC2va7m1qZOD72A+RL1WK6wKxgAwslm73bazZL7Kwl3cDmz0g4IdZE5+g VnP5MBsJhY2lTMwsMiXbPFgk0dxpRZBYOmZalHUTmAegWGL7JZP6Zx4WGBuASGwxefXr fxAtQiBgeCbAhILPVqqpstl6qAVLTUvMHGhvU+aJ6Te2EG40ghMxTtavYUOZz3/lM6X2 QdNKEqBOkOO0Mzol6E20USym5HvUpiOk67zNq/O+mrCY3bqAtaZrHhJdbz/cN/u2dp4I MII9ivVR1Js+ebeQbn5LAsx6q3x4ssZOrkgER9SCFXulwTXu7+1rMEpsI5phSSPzZJpB cTow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vKeFJp5p; 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 m22si2555351jaa.52.2021.09.16.09.32.07; Thu, 16 Sep 2021 09:32:19 -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=vKeFJp5p; 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 S234606AbhIPQad (ORCPT + 99 others); Thu, 16 Sep 2021 12:30:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:59264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241232AbhIPQVV (ORCPT ); Thu, 16 Sep 2021 12:21:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 284766140F; Thu, 16 Sep 2021 16:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808893; bh=arwvxEe1pbJ3OtQYHAw06QJ2AEQ6PjooBBC5KeMYr8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vKeFJp5p5rGvGOF0LM4u69ItbqxsJ69fFmNoTfGLaVD6gUmubBzspGVadKnSMMH2+ JHmTq98rnAJuU1ZO7uUikVUdSfto2EZKMDriKwpRCdmqUz776XJwcef6ydBQiLREvA e99mVWWaiel3qX+s35AC3jJJAcu7OxhEnqaKDhLY= 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.10 262/306] iwlwifi: mvm: fix a memory leak in iwl_mvm_mac_ctxt_beacon_changed Date: Thu, 16 Sep 2021 18:00:07 +0200 Message-Id: <20210916155803.008352451@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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 5243b84e653c..6a8bf9bb9c45 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c @@ -1044,8 +1044,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