Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2094015ybl; Thu, 30 Jan 2020 11:15:00 -0800 (PST) X-Google-Smtp-Source: APXvYqycDMxB84Ls3rLaJNv18RA6mq25p8fjsGGl7ZSA3lIDjU+Mb3dvYgkm83FjvxNAnsianSSi X-Received: by 2002:a05:6830:1607:: with SMTP id g7mr4699072otr.320.1580411699925; Thu, 30 Jan 2020 11:14:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580411699; cv=none; d=google.com; s=arc-20160816; b=jQgJhwC1dS1NKQBP/TAjqAV81VLopiLWAik76MlqsyA0obGaMPR1ZoQ6QP999veZGZ Ha3dNzj5t+deavJiWV9hsH7PNxdj3TTjLtxXEKBL2y7Dd714tRv9EUKySlKCDXDtoj2M ssr4NIUyp7I6LC31wujN3HjKP7j64bK9GRSEOgdSIK8hqTMjAqeyxM7txZo+6QBA0uPg G2G8uq2l6krGgWxQnIMfo+HEL+1/nNj9TT/PRSYU31OUozvez1cv3TteQ6JpSEOFuTe/ wOmRGUKpG9PxyiqjSiZV+CqwiLBCRs7BQ6FZn0F/h+2lbhbKz9t7JUdwG4m5lhuClkxI MAbg== 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=SJ2j3HsTHYvtg/E4tcA6Yxs+IvyRr3ioaIOW87I0H/rnLglE3U+pwI7mXWy26ty2ew rKMFwPJLSpz2Jq2SJhiq4A5T+/gOOsISJ202WJU7PsmCLVYKCqv7QZRdPp/T3RdSb7LA MFkDYPOVD8arFmAE31Zf2DXj3ubUpIWcSu/E3Byje2JoixAShy0nL+9MeZV5YbM/QycD KIHLJ4PDR5H0ZxXS1n7qgTuJTDPxedm93oWDFuZqno4UpY0xAnQ3pqh4jXiu4pyIoyhq 280lF6lpt00KlqQsSNzoXWOMcGmBf7fNdHI3WjHKyERcD2C/yxVDaKwYUU3YgqXL9Dnu 30rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JhXdbvIK; 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 g6si3430919otk.171.2020.01.30.11.14.48; Thu, 30 Jan 2020 11:14:59 -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=JhXdbvIK; 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 S1730153AbgA3SlX (ORCPT + 99 others); Thu, 30 Jan 2020 13:41:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:49268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730141AbgA3SlU (ORCPT ); Thu, 30 Jan 2020 13:41:20 -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 1309B2082E; Thu, 30 Jan 2020 18:41:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580409680; bh=ruD9v7iz3Y5cNeFCZjb02nuwwTlDJHiAKmIYc+H0aCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JhXdbvIKS66a/30acFqGbdY4XPrpQzt8eG9vI50ko0tRKWka/QUmVIpvOJ3824PD1 BhQzzZs5yzfyu/vOWsVA4nMyqeEVlsWsUte5v8p8Vrnxas8yZ6krN0uCsGmqd2MK1N xB43uFNy6KPIC8gYwb56HNj+ma8RvbsFXmXIQWjY= 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.5 48/56] rsi: fix memory leak on failed URB submission Date: Thu, 30 Jan 2020 19:39:05 +0100 Message-Id: <20200130183617.666376935@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200130183608.849023566@linuxfoundation.org> References: <20200130183608.849023566@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; }