From patchwork Thu Aug 20 09:19:41 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: 265487 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=-12.8 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 4537DC433DF for ; Thu, 20 Aug 2020 12:12:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 15E4E207BB for ; Thu, 20 Aug 2020 12:12:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597925533; bh=dLSZoe0U68+XiHw2ZjmLR1zZjUunThM8XsBc5V+pY8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zH2c4zkXOr/VHGh6hJNTsmyVpIMGCJ41Mvzwt+tTFEzbVyd0KLODSA9SVxZB0HENX 3iZ1Ke4nkaD7bn47VRiZZnLnBYpVhf49GKU9ujAZ9TdK6t+hZXYIRE2t8nNZbqG14S d9mnZ+P7bYxTfuCzbBADkdv3yeOoWrtUcAKnSzPg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729183AbgHTMMK (ORCPT ); Thu, 20 Aug 2020 08:12:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:41246 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730325AbgHTJ5h (ORCPT ); Thu, 20 Aug 2020 05:57:37 -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 3E5452067C; Thu, 20 Aug 2020 09:57:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597917455; bh=dLSZoe0U68+XiHw2ZjmLR1zZjUunThM8XsBc5V+pY8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vMg1GJ2FKCwPnJFeMcHC093XLscnHVO6J2wNtT2fy2kZdtZh7LHEhxkWNgxqB0Q4h cgjhp4FRYiuz5kURuViUl66gzdnXKVW1WNagCU7wNqiPWKeWGEwfJDesg45N5dJj9I HBWHG+xFyTPG8uDp7uZeqs3EYRIRbD8AVIrG/GX0= 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.9 008/212] ath9k: release allocated buffer if timed out Date: Thu, 20 Aug 2020 11:19:41 +0200 Message-Id: <20200820091602.678759128@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091602.251285210@linuxfoundation.org> References: <20200820091602.251285210@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 8f14897ae5a33..f100533eb7adc 100644 --- a/drivers/net/wireless/ath/ath9k/wmi.c +++ b/drivers/net/wireless/ath/ath9k/wmi.c @@ -340,6 +340,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; }