Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp9000629rwb; Thu, 24 Nov 2022 06:56:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf4mQO8/mpU+fuuNEPEVzkw/ul5ji98DHs8sc2wXuZAVduMrMSyfniUiiD3eH7LYyOkjAqkt X-Received: by 2002:a17:902:c3d1:b0:186:886f:e1e0 with SMTP id j17-20020a170902c3d100b00186886fe1e0mr14171601plj.162.1669301808656; Thu, 24 Nov 2022 06:56:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669301808; cv=none; d=google.com; s=arc-20160816; b=z/rYVcVlcctjupur310JgGnHlbtsN8W65IL+Scskr37t6JRN3FupsQxnDbSvU28iXv HPN6+8VMGRPbh38ekvTNA0c7rsq1wJ9geldeJ1dP+LNUNE+nbeBJ1S/fda7rkklumDS+ EHNcaBpm07m2N+77uSQi071wmFDYmQXUSbEfQ72tbfSvB4b0t/vD4sLHlt1PeYoWgJy3 uOSCwUll/FllxtJ5jAVQy4bKc45scsPguY6hNTAYEppZVi1S/RJm+UhJI6Lc8APdLkbR nGdmfb+AFu4o25HWFQ5EwWrEDGzw9YJ5Md8tRx5BW/1a9tu40T2DVXwv0h16ch8A9Ffe CBcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Htm91nE071JbwEGRcJRj6VrgLrVI1Du7SjwPCFdaMow=; b=oEOYvpATzYERBUSoKprMC+3O5rebekfFZKV6Ka4No1S1w1xOvH1qX4+ebXvKH2FRpe oagOc5Ypv+5unPLNP6d5HVzSWiTR9wZYnpq80RGxPRHdC15VS9hD1I4vn7VvDqvXgLVB n+folW1rr/x+5qQsBnclxekfp7tbF320tt/xAjwU6g2GbQzawpHjjAXO19Rz+5BZxeYc sOl8Z45awqcBNicCPo4ZX8j3qaUxGBYDWWNKsvOY8++3uztPVk5qytb3o1RJyKKzpv1G bveSN9Izs5I9XfA599zratKArlfp+zqXouXWPtWooltbbA485b56MCerxGWBF5mHrY6d QJ4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id me6-20020a17090b17c600b00213dce992c1si1729874pjb.7.2022.11.24.06.56.37; Thu, 24 Nov 2022 06:56:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229585AbiKXOpz (ORCPT + 87 others); Thu, 24 Nov 2022 09:45:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbiKXOpx (ORCPT ); Thu, 24 Nov 2022 09:45:53 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B032EC78F for ; Thu, 24 Nov 2022 06:45:52 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyDTu-0002tY-0V; Thu, 24 Nov 2022 15:45:38 +0100 Received: from pengutronix.de (unknown [IPv6:2a03:f580:87bc:d400:5507:4aba:5e0a:4c27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id D20CF12867C; Thu, 24 Nov 2022 14:45:33 +0000 (UTC) Date: Thu, 24 Nov 2022 15:45:32 +0100 From: Marc Kleine-Budde To: Jianglei Nie Cc: yashi@spacecubics.com, wg@grandegger.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mailhol.vincent@wanadoo.fr, stefan.maetje@esd.eu, socketcan@hartkopp.net, hbh25y@gmail.com, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] can: mcba_usb: fix potential resource leak in mcba_usb_xmit_cmd() Message-ID: <20221124144532.6u3hnvb6b2ninlxy@pengutronix.de> References: <20221120101414.6071-1-niejianglei2021@163.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="kd4a5kaznfiyppsu" Content-Disposition: inline In-Reply-To: <20221120101414.6071-1-niejianglei2021@163.com> X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --kd4a5kaznfiyppsu Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 20.11.2022 18:14:14, Jianglei Nie wrote: > mcba_usb_xmit_cmd() gets free ctx by mcba_usb_get_free_ctx(). When > mcba_usb_xmit() fails, the ctx should be freed with mcba_usb_free_ctx() > like mcba_usb_start_xmit() does in label "xmit_failed" to avoid potential > resource leak. >=20 > Fix it by calling mcba_usb_free_ctx() when mcba_usb_xmit() fails. >=20 > Signed-off-by: Jianglei Nie Applied to linux-can. Thanks, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --kd4a5kaznfiyppsu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmN/g4kACgkQrX5LkNig 010q9wgAsGR/W7WPpvudvy/7dkjbwq2fVAQGbS68F1LyfZeISBI80NaWc1PMF1lj J329herD+T+wmhrT7WIYAXjjiSXg1P3eGdNTk3Xe7vnbKoFcmTRIHZ8cKBfyi6zP bf0Nu3MHfoTwi642VHmm97ZH0+qdQ5mB2f0Q9+k2+Y19lBC+lGvy7op4635krQ9t egdwUw1XnbaLFN6k8xUxVW1y36401ZMvicC/LwGVqdKk7pclYbzHdhTZ7oGP2uW3 vFrtfhsrPNK8/S3TWGmB2bIMcWF0VAHLjXIsPSCCSYxbjHzUEvjtrhjya4Boltlr fVwu7Rxi/lDoBViwe5oo1yXbLHYy9g== =rsFT -----END PGP SIGNATURE----- --kd4a5kaznfiyppsu--