Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2021177pxa; Mon, 3 Aug 2020 05:35:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3LfTJalW3aQmmqH8BpRkVk/zrzh8CG+XkqlCT8D4K7Ay6rCegSHuNzPk2jTc/vkyEosfV X-Received: by 2002:a17:906:3f82:: with SMTP id b2mr17201824ejj.240.1596458125923; Mon, 03 Aug 2020 05:35:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596458125; cv=none; d=google.com; s=arc-20160816; b=IHmChhQ7XZCiCXtlCq6cX6z/3zFQ87zlXRPPoK+4A288IGIyx+u0wYAYpVeiVE/ftZ gtSUPjNWkQww+KYMLXRXHlk1paQU41eWflioUebJk1h9l6hjd+fiQeupt3WJFP5TFFFe 1Z5mHmuz+bnHIOfvLm+griWX/EmXIrtorTJMLzflsfQtz/xWQQo6r5vbw9Vse284+zwY GeMGiNWOu+/nC6OaTiAp7uY71Z62PdRCc6zPwhCcCHL6HVJWCzvP3ZNZaCrqPQna56b7 ji0T3G1oTDGaLiv8ixx6VfZtccg9MXgClm2oU6REvrQfWodDS91RSODCF2fU8OTXd6f6 1dqQ== 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=3Zeb7xexH7TRsX5elWN6ATfsgALiJGr5aHUUSar1mxE=; b=J2sCYzOmvEfQy87XlPKBsDSXQDG6nV0ukBgSQxL0rmitysS3vhQG3b2WRtlAw52CY8 VdjQupV7TbGcWS0PjXuSmH2a0O2jkFFXjShYSLkJY60a8Z20DDS4v5hziXusRlaQuGMW 71nJk7UApKdBwM765HcVAzlwXflJYIKSOC4iEWHONkI/wN3wshlHsa2STanhtmKOfxkl bx6uEh1V7jnQSf9g0RoatP/KB7I6fxlrxFmIL2j3IMOarSGGGhr150thQgHPJNYy+Wd+ R0voavWwr6eFm2MMu3lI+VNPqEj2XfU87FqctN8ea2rNHKTASjDEdPJlSl8Ecn44NnC6 rNHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SQbJUF6w; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kq1si9416378ejb.246.2020.08.03.05.35.03; Mon, 03 Aug 2020 05:35:25 -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=SQbJUF6w; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729232AbgHCMbv (ORCPT + 99 others); Mon, 3 Aug 2020 08:31:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:59576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729229AbgHCMbt (ORCPT ); Mon, 3 Aug 2020 08:31:49 -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 9CAAF2054F; Mon, 3 Aug 2020 12:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596457908; bh=Sp098mK9dW4CZGeuDCp6QtJHCUMG3PJjoVI6NAk/A5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SQbJUF6wJ7oC5ETJ/+ds2s+/J9/JLFo+O+njRIXUGDRl3OPwG9iPGTrcNrAEsxw+3 Lm6BCvvHr1yd4wMEdc+PBj42SjtSNdjxuehcKJcc0Gyxpo6USjZlPAFEvBllVKXCxV EK/+0hJIWjpW4JshKKXlxfePtnB9N53DMi3fr5C8= 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.19 06/56] ath9k_htc: release allocated buffer if timed out Date: Mon, 3 Aug 2020 14:19:21 +0200 Message-Id: <20200803121850.621312769@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200803121850.306734207@linuxfoundation.org> References: <20200803121850.306734207@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 d2e062eaf5614..f705f0e1cb5be 100644 --- a/drivers/net/wireless/ath/ath9k/htc_hst.c +++ b/drivers/net/wireless/ath/ath9k/htc_hst.c @@ -173,6 +173,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; } @@ -208,6 +209,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; } @@ -280,6 +282,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