Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3712800imu; Mon, 28 Jan 2019 09:28:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN663FNIXsKHtIxCFO8bIrEjA1hslf4syHlXobIB+iOvzfXCofrcaLIqzaHm0qiwMGT4Yycd X-Received: by 2002:a63:b94c:: with SMTP id v12mr20535164pgo.221.1548696512370; Mon, 28 Jan 2019 09:28:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548696512; cv=none; d=google.com; s=arc-20160816; b=LcOu7kqq/TqYOUTGVrt/5CuZEWwf6qX3E4A+NNvV+0LDzdK2Y6HL8CyP12tfJMITcw rlagTmexFhzQAJ9BZ6dDWBK2iCkggmUUuoHVJxV8pnEb+GuRvLn1+x2JeZTVvXlpifVE xnsCXTMwT88ImafrZxlImLiiRfSxRxpYFCx3RxgzAQMy/wfT63fgVnDfXjdAhc5Boc7w t+LJygr08BidosM0x1hrDAM9Gc2KNlyhgewTSNn4bxIhw/mh///W3/R2xyN7+bVB2tUM RT0uTSVppqR9QbtqV4hRWOaLwGpHrZNZN4eC3ht72Sneh2prVG/ELLQWT/Agq13q9PKl SDjg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rgLEUeN9Ov9zzU3xbPRAOcnXyMq1nl6mrw7sbWIkVnE=; b=M4HESqyPWPJq1GzWBmqxicIN6kNpnpi5n/t+u5M2L8ovUnsGIXxJfAdgDlY+ZiKdH9 aNsvYBIA/C3H1APmF4tbG32C7pb0IQAeKtu36zwYvGxGIEX8izGPtAbQrk2/MA7QbDXg RwKFKMKx8oQlcJBg5Rcvgns/lkgi0+s2bnLRTiYW53i9eP4BpnjdmB5PbYYQpGx0dO7k jLbVcOW5CocDhaAgMeQqnFHj3gqYOvbeL8sSd/iHV6OwrGtxO8WgN+mCCppoM4eiloLh dbthzDsh05dSKck3QwTSIx0Embq38F/i3ATjV1FBDfC83N9MEh/Vaj1jLVo7h4vb1ypo vDDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LocSPK7+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5si31812117pfe.52.2019.01.28.09.28.17; Mon, 28 Jan 2019 09:28:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LocSPK7+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730904AbfA1R2H (ORCPT + 99 others); Mon, 28 Jan 2019 12:28:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:45278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730404AbfA1QAA (ORCPT ); Mon, 28 Jan 2019 11:00:00 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BB1BA2175B; Mon, 28 Jan 2019 15:59:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691199; bh=sGPrnnt4LNGpIXsfQSBa+4zvfJ8mFUE7DDbc95Ih33w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LocSPK7++5ywdNSRIoxwOswNcTrXx6wcod8xPKqtN0+U/OktXnRMPzbI8FQ+6S6ge 6Y48e3ewUxLm00rjL0uqWvyDloU7lnES4H+CfGylLoBH5vbXOxbHihE2HmfE+rLVAf rrYYsGlsV09KTUqmK7c57Nr9NNiEGJM4d78JDFxg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Lior David , Maya Erez , Kalle Valo , Sasha Levin , linux-wireless@vger.kernel.org, wil6210@qti.qualcomm.com, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 012/258] wil6210: fix memory leak in wil_find_tx_bcast_2 Date: Mon, 28 Jan 2019 10:55:18 -0500 Message-Id: <20190128155924.51521-12-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lior David [ Upstream commit 664497400c89a4d40aee51bcf48bbd2e4dc71104 ] A successful call to wil_tx_ring takes skb reference so it will only be freed in wil_tx_complete. Consume the skb in wil_find_tx_bcast_2 to prevent memory leak. Signed-off-by: Lior David Signed-off-by: Maya Erez Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/wil6210/txrx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index 6a7943e487fb..75c8aa297107 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c @@ -1313,6 +1313,8 @@ static struct wil_ring *wil_find_tx_bcast_2(struct wil6210_priv *wil, wil_dbg_txrx(wil, "BCAST DUP -> ring %d\n", i); wil_set_da_for_vring(wil, skb2, i); wil_tx_ring(wil, vif, v2, skb2); + /* successful call to wil_tx_ring takes skb2 ref */ + dev_kfree_skb_any(skb2); } else { wil_err(wil, "skb_copy failed\n"); } -- 2.19.1