Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2770616ybt; Mon, 22 Jun 2020 06:39:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWatd34XwG9VjQvKLzPw8NGhtATN/4+0uKIWjdcoNd6GoRWOBivzune0oFrW1VI34J96R6 X-Received: by 2002:a05:6402:54d:: with SMTP id i13mr16999152edx.330.1592833195724; Mon, 22 Jun 2020 06:39:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592833195; cv=none; d=google.com; s=arc-20160816; b=puXeFH1cWBEdsmejSK7DghZxX3HT32n9DCKNRHj8FCLDr/Sq9co7tSR6FoTEpEdMPh T+wTM+goxOlvkgVKZYEqBqVVNX3zUiRjg72zRFCGk8PgbWSYLXSgsYYUjCli1e4NFnd4 bDoWkD2dvjEDSORfePXvHlmv0atYn8LzjrPH4KGjhzqG6H7AwIEOk7ke1r72fDwAphpW Ehz8E2d0omWwTJnO6ehPeDjfgEVUXvIYvQ3hanCA3A61cSH9JYLsSSuLlf2oRnHqC8y/ quC1/axy2JIJzAcfEwK0vXM/6EYX4Ee2kqO/2hmJXg4scGe1HdCrWQLK4+wq5BMf672k 0kxw== 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; bh=N7mgVVyR+w1b+FncW8OtKNa36zEcNIQoeyrB8ZCWYRQ=; b=FKNvhKuSN/96tAknD1KwKq1BTbxo0C9KFf8GNZD/BOu+qdMpuX631NtOs7H7viA+lu mH8Zv7vvAvy0JOPUGJieV8QZ0Y+SNzCN9YQGxzGg0B1Xenp9/YJfR6XbEpTKcHX3IDjs i8sFIfmJ6r9bj150SncVv1ZRNlv3Wi3EhsV7pliERJDfDVXdVR2GLZ5jm5D1GiBKtSh1 H/4lOfpm6P5Km98KqDVo7LJNYGolhkpW9deQTAzWhsUtBszLgFaAyGRv1lIILj3mbP+J 5rWXseTtliWCjRGe0RLKWyd7xxKvy9bwkq/SporQJpjm/4gXkRIJjXZbAEkJKVEcjGhn +MwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 n24si9377751edb.277.2020.06.22.06.39.20; Mon, 22 Jun 2020 06:39:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729257AbgFVNiI (ORCPT + 99 others); Mon, 22 Jun 2020 09:38:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729256AbgFVNiI (ORCPT ); Mon, 22 Jun 2020 09:38:08 -0400 X-Greylist: delayed 941 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 22 Jun 2020 06:38:07 PDT Received: from mxout017.mail.hostpoint.ch (mxout017.mail.hostpoint.ch [IPv6:2a00:d70:0:e::317]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3FA2C061795 for ; Mon, 22 Jun 2020 06:38:07 -0700 (PDT) Received: from [10.0.2.46] (helo=asmtp013.mail.hostpoint.ch) by mxout017.mail.hostpoint.ch with esmtp (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1jnMPb-000LiO-KA; Mon, 22 Jun 2020 15:22:59 +0200 Received: from [2a02:168:6182:1:4840:f038:bf12:aa10] (helo=ryzen2700.dss.husqvarnagroup.com) by asmtp013.mail.hostpoint.ch with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1jnMPb-0006GV-27; Mon, 22 Jun 2020 15:22:59 +0200 X-Authenticated-Sender-Id: reto-schneider@reto-schneider.ch From: Reto Schneider To: linux-wireless@vger.kernel.org Cc: Larry.Finger@lwfinger.net, Reto Schneider Subject: [PATCH 2/3] rtl8192cu: Prevent leaking urb Date: Mon, 22 Jun 2020 15:21:12 +0200 Message-Id: <20200622132113.14508-3-code@reto-schneider.ch> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622132113.14508-1-code@reto-schneider.ch> References: <20200622132113.14508-1-code@reto-schneider.ch> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org If usb_submit_urb fails the allocated urb should be unanchored and released. Signed-off-by: Reto Schneider --- drivers/net/wireless/realtek/rtlwifi/usb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c index d3bbfc0171f6..1a9fcb2697bf 100644 --- a/drivers/net/wireless/realtek/rtlwifi/usb.c +++ b/drivers/net/wireless/realtek/rtlwifi/usb.c @@ -720,8 +720,11 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw) usb_anchor_urb(urb, &rtlusb->rx_submitted); err = usb_submit_urb(urb, GFP_KERNEL); - if (err) + if (err) { + usb_unanchor_urb(urb); + usb_free_urb(urb); goto err_out; + } usb_free_urb(urb); } return 0; -- 2.20.1