Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2098939ybl; Thu, 30 Jan 2020 11:20:06 -0800 (PST) X-Google-Smtp-Source: APXvYqzE2NxIdKNa4GWVkH9YhKaepBRpKwLVMyROtDCFlTqAvdY+Dt1bSBQT9+mRpZEGi3PGiL8I X-Received: by 2002:a9d:7489:: with SMTP id t9mr4676032otk.205.1580412005916; Thu, 30 Jan 2020 11:20:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580412005; cv=none; d=google.com; s=arc-20160816; b=zVd0O/g++gVl/hF+Rn6bYe5lrb1BdBgOev+GbiyDpj22TUMUQfNudsLCofYzpnTRmm gdXxlH1i2SjKKO5gu4602EUK/GGhUF4xIQLMAi7qxGfa4jImdhRdcQ2HjzNLr1VSYl5Y a0agZtormEELSVrBdRTjcVORtOEDkEXFPzOixSRG9FfEq2zWtjTnwPmjT79jXcqk+Bcp 6Lfuyt1zc0fjR4osppb2tOx2Qb/zyDV0mVI3Tl6fiKcKMaQ2JU6lMcYhOiAtrD6uG9dd iy7Ahp56loa/muM0h2rAnOpXQt/h4Am6H+GepF1VFpJVJnXm70kY2/k6VRAcL1wq/g/n EGxA== 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=VywSxqNYK91r9cOi00BjNfLWpT6xYttXkh2pPZ/Q74I=; b=VlthHLpRvyybgOXlAUKg338gcbfgNRhw7Jyzo+ATC4dU03XrIZMJzX/e8DFd9XQ1NW hhAzkLa40vhQOj47BHkF4++3ZsNPZ0/Z0dX8RKhdKwAbv38QnFinHBqFfrWJza/BEQIY FYoKwCgQUmq0WDOAGrtGkMKnoOEkURtnjwEzHQ+zqp/bGDAlMaWvvuXjpZpc51kj6Z4h EJgKW29LBGUcE0+z7XDVTXcN3BdeHBFW2GwC0srGcIVYXMkfa/b7AWC4o4LoVACXQGKs QpiTPlPaDIosPEqi09oW4eslpHVIfUYef+IDafIENl8zuhMTqt8duMuA9mcYDaoi19iy +k8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dGYEuCZM; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1si3669619otg.113.2020.01.30.11.19.53; Thu, 30 Jan 2020 11:20:05 -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=dGYEuCZM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731241AbgA3Sqn (ORCPT + 99 others); Thu, 30 Jan 2020 13:46:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:56858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731235AbgA3Sql (ORCPT ); Thu, 30 Jan 2020 13:46:41 -0500 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 68FEC205F4; Thu, 30 Jan 2020 18:46:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580410000; bh=ruD9v7iz3Y5cNeFCZjb02nuwwTlDJHiAKmIYc+H0aCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dGYEuCZMoKL+HUBEF2N1ppxd4e3AB6oUFB/h1stJJkBfh9g73rB4sW3hZguZpASFw hPARRJhMHu+viPmcIsWaSM8AM4pZR1z90N+EW6MDiGKmksOI+4EEld6rJeNwOj8a6B REthfRw3xNZKtlZPvqhpB/6bjH/0Ej6RW51BfCOs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Prameela Rani Garnepudi , Johan Hovold , Kalle Valo Subject: [PATCH 5.4 102/110] rsi: fix memory leak on failed URB submission Date: Thu, 30 Jan 2020 19:39:18 +0100 Message-Id: <20200130183625.718011784@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200130183613.810054545@linuxfoundation.org> References: <20200130183613.810054545@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: Johan Hovold commit 47768297481184932844ab01a86752ba31a38861 upstream. Make sure to free the skb on failed receive-URB submission (e.g. on disconnect or currently also due to a missing endpoint). Fixes: a1854fae1414 ("rsi: improve RX packet handling in USB interface") Cc: stable # 4.17 Cc: Prameela Rani Garnepudi Signed-off-by: Johan Hovold Signed-off-by: Kalle Valo Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/rsi/rsi_91x_usb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -338,8 +338,10 @@ static int rsi_rx_urb_submit(struct rsi_ rx_cb); status = usb_submit_urb(urb, GFP_KERNEL); - if (status) + if (status) { rsi_dbg(ERR_ZONE, "%s: Failed in urb submission\n", __func__); + dev_kfree_skb(skb); + } return status; }