Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1138409pxa; Thu, 20 Aug 2020 03:41:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1wnF6XhAYridH2HOgL3RH17GbNJtaOk4vkzVdH+6I+SwCSdLat3mTz52W25pCU08gMDjQ X-Received: by 2002:a17:906:e87:: with SMTP id p7mr2483428ejf.547.1597920087167; Thu, 20 Aug 2020 03:41:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597920087; cv=none; d=google.com; s=arc-20160816; b=YJw5xa1V1kD5pFF60Fv1R8IfUjJawwCuZPPwPLo8CKHn/aiRz2owQbJYw8kYDgiW1R viLLPm80rL+Kz0VJg8HS1KqC7aKDjPuHB+mmztqyncJSNR2bCEN5P37MTIS/EUfkYViq MZKeDNpJBbA3GSyiz3jKUx8In/iITDo/NcZZbNFXugKaGl8bRqYnD6iWz+2rf7PBAbBs WYBRkMAWIS9/l2zwSzb+KGW2suRAGnJuQxp+1yhbR4GCf1f36hnh0RKrFkEe4T+zna7D RR32LxqjQkXoacBoWadveYpSUaI0k1cQ/Z9DcbcdGxlgmxESeGKRyVRPbqp4H3tiznNW o1yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aAuTXrytHQe+wcLWazwISwYdI0DIPQttaT3+gmggwsc=; b=K88N3SYzxY8enKsUlOWyiAePt72lorr49nesIeVkXpnG6yrzJAxHPhDYzsUVdS/JUs UFkiipoEBVRgfm/X+d3YkcT9tmM+7jLOrgYL5m6vJE+lBDOPKLVOkKKMmBUuHq9BrWEV KLkjkN8IDzNM2121iu+evC0hhF9l68dFbssbPrn4jq2QQQsECaS/QHRtfkDVkl0Vf/3P KkNqXBupMOAkwQi09Yf+d3WtN5homYk8AjUVqP44lVfLT8vfMb8somBzuWK4XFzHvpwG AysnelfPZhFSOI2eHBatLKoLxNE5ZRp+BVU5wK10Fi7sPudxbdz2eSJQkrQ9JEklDJ5G DElg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2N2eXMzF; 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=fail (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 v25si983730ejb.238.2020.08.20.03.41.03; Thu, 20 Aug 2020 03:41:27 -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=@kernel.org header.s=default header.b=2N2eXMzF; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729938AbgHTKR4 (ORCPT + 99 others); Thu, 20 Aug 2020 06:17:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:38338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729368AbgHTKRP (ORCPT ); Thu, 20 Aug 2020 06:17:15 -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 3D7BA2075E; Thu, 20 Aug 2020 10:17:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597918634; bh=UtA49LqjWfOiF+UegpH3bqGT9EIXZNTUrGsjO15YjNA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2N2eXMzFK7GvyzKXLZqi3znQtGJH4UgmMT3uwaMtiudpbsq5oylHTnYtb1Kn54rF1 i8fizR2bAJbc4K8iYotveOJGmBCaTSNRY3RbhFIDLkJwaq2RLk0A/RWGXCk4vZcGr6 8kX5oSwe3S1GxCyOvq26ZHt5l3IqR0Id1zBaeElc= 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.4 004/149] ath9k_htc: release allocated buffer if timed out Date: Thu, 20 Aug 2020 11:21:21 +0200 Message-Id: <20200820092125.903127111@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820092125.688850368@linuxfoundation.org> References: <20200820092125.688850368@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Navid Emamdoost [ Upstream commit 853acf7caf10b828102d92d05b5c101666a6142b ] In htc_config_pipe_credits, htc_setup_complete, and htc_connect_service if time out happens, the allocated buffer needs to be released. Otherwise there will be memory leak. Signed-off-by: Navid Emamdoost Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath9k/htc_hst.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c index 257b6ee51e54b..1af216aa5adae 100644 --- a/drivers/net/wireless/ath/ath9k/htc_hst.c +++ b/drivers/net/wireless/ath/ath9k/htc_hst.c @@ -175,6 +175,7 @@ static int htc_config_pipe_credits(struct htc_target *target) time_left = wait_for_completion_timeout(&target->cmd_wait, HZ); if (!time_left) { dev_err(target->dev, "HTC credit config timeout\n"); + kfree_skb(skb); return -ETIMEDOUT; } @@ -211,6 +212,7 @@ static int htc_setup_complete(struct htc_target *target) time_left = wait_for_completion_timeout(&target->cmd_wait, HZ); if (!time_left) { dev_err(target->dev, "HTC start timeout\n"); + kfree_skb(skb); return -ETIMEDOUT; } @@ -284,6 +286,7 @@ int htc_connect_service(struct htc_target *target, if (!time_left) { dev_err(target->dev, "Service connection timeout for: %d\n", service_connreq->service_id); + kfree_skb(skb); return -ETIMEDOUT; } -- 2.25.1