From patchwork Mon Aug 3 12:19:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 266875 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F25FC433E0 for ; Mon, 3 Aug 2020 12:34:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F4282076B for ; Mon, 3 Aug 2020 12:34:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596458050; bh=mGIoNqX0wHrYxrN0N04836iTnMVld3FpDskrIXmcDW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Fmhsf8NHiTbC5Z/2JJRDDc1AF5eC4ITm2/guij61j1vmx/cEY6HbBOpZfgQUPxwq+ xy1G5K2EJ+d7nMI75dAGSrMlma3BwBrm6Bbf7w4wTJh7+uIeuOjp5wT9wJRzqoaeZ8 NdPOQhG6DL6a5zxua31xQ2tLGJtHTBbej4kPrJp8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729526AbgHCMeG (ORCPT ); Mon, 3 Aug 2020 08:34:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:34126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729112AbgHCMeE (ORCPT ); Mon, 3 Aug 2020 08:34:04 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5BF68204EC; Mon, 3 Aug 2020 12:34:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596458043; bh=mGIoNqX0wHrYxrN0N04836iTnMVld3FpDskrIXmcDW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XRVX+9xPjGegsivOQWDeOU/qaWdoH9dYQ2eql8RhZcOdFffmfzPGD82aYdx5Uf0n4 ttR8iFl4u9/esiBO2ni/EKpa8qLOniB45omZG+MBiPFfqeGFZ9BSKQ7TzdP4okwvpF RPj8f0EFzFkwSqJnjuVlBvg+wqEyavJltWopvsQQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Navid Emamdoost , Kalle Valo , Sasha Levin Subject: [PATCH 4.14 07/51] ath9k: release allocated buffer if timed out Date: Mon, 3 Aug 2020 14:19:52 +0200 Message-Id: <20200803121849.821831945@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200803121849.488233135@linuxfoundation.org> References: <20200803121849.488233135@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Navid Emamdoost [ Upstream commit 728c1e2a05e4b5fc52fab3421dce772a806612a2 ] In ath9k_wmi_cmd, the allocated network buffer needs to be released if timeout happens. Otherwise memory will be leaked. Signed-off-by: Navid Emamdoost Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath9k/wmi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c index f57f48e4d7a0a..4b68804f3742e 100644 --- a/drivers/net/wireless/ath/ath9k/wmi.c +++ b/drivers/net/wireless/ath/ath9k/wmi.c @@ -338,6 +338,7 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id, ath_dbg(common, WMI, "Timeout waiting for WMI command: %s\n", wmi_cmd_to_name(cmd_id)); mutex_unlock(&wmi->op_mutex); + kfree_skb(skb); return -ETIMEDOUT; }