Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2576006pxb; Fri, 29 Oct 2021 04:22:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwW1egEip71U+faytW06IBl/D/GLq6E6fwS11gdzh+EN4TuJOdIFdwP0mrsfTVrppEQZtRw X-Received: by 2002:a05:6a00:812:b0:47e:4c65:2a77 with SMTP id m18-20020a056a00081200b0047e4c652a77mr8607186pfk.51.1635506529116; Fri, 29 Oct 2021 04:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635506529; cv=none; d=google.com; s=arc-20160816; b=EdKkLN2UTCVqGcnGryLTcV6NaWOVPvJgyJHJRohFTyMwTB00xFYnWHi6eWpCh6AXbi EKrz2loFwHyv4pOfKjbtfDFPv6tCr6Qv8JnyCP+oQV851oDTK4RRRpLPmtI4GpV2R2df RvylrwVxJQXqPVzHNQF9n4TgwgrynQwbrCTtMFMQKou2J9Ne4GzdCCN/kipcsDtSfBRz 9a6w5Ex7QAun3+Ox4luYLNUcs7uGNg4GWBHwwLPrmcBprwYLftNJaO/fx+gmC7pWukTO DMaWXjuoLVh6uMnF1toQIIDAVpEcmF0R5QIwFuG9scdpvOKOg2exvaBiiNXjDe5vwu/F tJew== 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=6eBPyN1pp6UbR4RmuoDf1mz5vg6jlD2M0ATcsWLBL8k=; b=PsR1m0QsIlkhDTf7F9VSBcwhGDew8/qQwiszPgCc8dVcUfrdBUGj/2CUFlnIj1elmD VC4pwYxiadRRwczlzb/4dymK+0fwBrGTHzlz55YrpcZe5QfKIYb9Ni3Sx899FHAXo7hp dNv49/scVXqEpRkUfZjpwczRLhR4i9kmP90Q04qL9+0lqMRukz508TPlhhhCRRJ109te rEoa9ePZQutazuXyUuubrickz4o6nWXwfUxvwXWwwHqEE9TdbWlLjxpO3OsMsMnCJl08 WtPP/GAyDMmpJFV6r6imjXmeSl4yOeJGE4Z7IW+6meAdxUN0sryvmCwifV69goHqGNN5 d13w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 79si2451804pgc.601.2021.10.29.04.21.54; Fri, 29 Oct 2021 04:22:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231815AbhJ2LXY (ORCPT + 99 others); Fri, 29 Oct 2021 07:23:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231538AbhJ2LXV (ORCPT ); Fri, 29 Oct 2021 07:23:21 -0400 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 0CD62C061714 for ; Fri, 29 Oct 2021 04:20:53 -0700 (PDT) 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 1mgPwJ-0003Wt-FC; Fri, 29 Oct 2021 13:20:51 +0200 Received: from pengutronix.de (2a03-f580-87bc-d400-e533-710f-3fbf-10c2.ip6.dokom21.de [IPv6:2a03:f580:87bc:d400:e533:710f:3fbf:10c2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) 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 A68C86A0944; Fri, 29 Oct 2021 11:20:50 +0000 (UTC) Date: Fri, 29 Oct 2021 13:20:49 +0200 From: Marc Kleine-Budde To: Vincent MAILHOL Cc: linux-can , netdev , open list Subject: Re: [PATCH v1] can: etas_es58x: es58x_rx_err_msg: fix memory leak in error path Message-ID: <20211029112049.j3wbh2aka4qfeq5l@pengutronix.de> References: <20211026180740.1953265-1-mailhol.vincent@wanadoo.fr> <20211027073905.aff3mmonp7a3itrn@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3ontns5duwddut54" Content-Disposition: inline In-Reply-To: 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --3ontns5duwddut54 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 27.10.2021 17:48:21, Vincent MAILHOL wrote: > On Wed. 27 Oct 2021 at 16:39, Marc Kleine-Budde wrot= e: > > On 27.10.2021 03:07:40, Vincent Mailhol wrote: > > > In es58x_rx_err_msg(), if can->do_set_mode() fails, the function > > > directly returns without calling netif_rx(skb). This means that the > > > skb previously allocated by alloc_can_err_skb() is not freed. In other > > > terms, this is a memory leak. > > > > > > This patch simply removes the return statement in the error branch and > > > let the function continue. > > > > > > * Appendix: how the issue was found * > > > > Thanks for the explanation, but I think I'll remove the appendix while > > applying. >=20 > The commit will have a link to this thread so if you don't mind, > I suggest to replace the full appendix with: >=20 > Issue was found with GCC -fanalyzer, please follow the link below > for details. Makes sense, good idea. > You can of course do the same for the m_can patch. ACK Added to linux-can/testing, will send it out once v5.15 is out. 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 | --3ontns5duwddut54 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAmF72Q8ACgkQqclaivrt 76lmjggAgVEFYhCSrfVs/XJ4BtVqBfoSfVDyDSH72wrrpPjSJmnhF3lpmEYSbtGV UurPx4ZtIQcwAxEYMshYoN4HLLuM7j3SDJjWrNjKJuaLORG4SiMakohlX4Begpw2 V4p9xBKXxfYxBL0v/9r0+3bz+74bUuBEP42BldIf9h4iGrIGoQO4gPgKOhs5kBqL 6JIInyktdt1cCW2P/Tui2w5axJ557RO6ObEMquXZA41XzrvS8FZxJqE60ic7WRo/ 2K+VDhJEO3kvOjuRlBEXM+128pEnRBOmWrf7vH9rFx5tgHxOteXU8pix0nkQM+v9 9IDmxxH1fTEt6+h4pPaBandCRH/wVQ== =njFK -----END PGP SIGNATURE----- --3ontns5duwddut54--