Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp851914pxb; Wed, 27 Oct 2021 13:44:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6sZPezXIfkcHwbYmJWsNXxh2S0SnSSseSqFGyILkeDUbn8eSYSvTe4Lf5gfJ29asTFUUh X-Received: by 2002:a05:6402:84a:: with SMTP id b10mr148933edz.257.1635367490049; Wed, 27 Oct 2021 13:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635367490; cv=none; d=google.com; s=arc-20160816; b=NNoI3h1MhUjC4uV6wv5hAqBwJpMpxOsVLGmqqjWEB6DaTg055IOHDcz97LG5zSqX6L oWrl9MZ4s6RLr8xOIchgbYRyOqaBHQGS9wdK3Lg7KESE3G9pFOEnq3un7F6Lr9g5AWoQ 5de2LjgSNB8gidnDWrXWLpP/noY3K0Fe/Qd1zmMl02byW5xS+u9cQ9fSi+lFzf1KSQ1B GyWNk8EvrsPSgHABG3RLNrLDRfBDeYAo1u10iCcVy5A0ZDJw5txlHQzQ9AqyiX48jz0Z 0+qOEPc3yd3449gqBhIey8JKSQO32pMafN50gcU2PNmq3CrVjBW26wau92gqEpA8e45T sbkA== 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=YtD56EY0/SZtLFbl+eHMxo9BqOoCgw6od+9Wh0ialrs=; b=ZqFfyojq68bKYXVhB6Qgog1arm0OhcUvRUqaUR+EjAJm5V21Ccxe+uudf2SpN3yvuk Mg76DRfJmakJqR4agswD8rLnjCN4G3pPNMbpcNfiWEftPS30b0DiNCJHXAz3jQ3brnLu K8C5jcYTI0OnEgJkL9mxmumTvQ9HHAwIrWLsT7926Lpsxhh8IHLkCKiieETTG6/mcpi9 +PoFYn+MwPfhOOVyiP2Ne2Vzbcp8+fBt3J+tAGhhJY57ud9W8ewiu3HH/HQ0snYqUayG 9CLFtBI6YQZRqCJypOAFxQKa/a9NjoxP5cHDncl3KAcspC41tkTu6XSootPeRRzW1m+v amsQ== 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 nc15si1591133ejc.443.2021.10.27.13.44.25; Wed, 27 Oct 2021 13:44:50 -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 S240538AbhJ0Hle (ORCPT + 99 others); Wed, 27 Oct 2021 03:41:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238693AbhJ0Hld (ORCPT ); Wed, 27 Oct 2021 03:41:33 -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 D8841C061570 for ; Wed, 27 Oct 2021 00:39:08 -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 1mfdWd-0006Vw-Cs; Wed, 27 Oct 2021 09:39:07 +0200 Received: from pengutronix.de (2a03-f580-87bc-d400-7316-ec5d-e57a-90b9.ip6.dokom21.de [IPv6:2a03:f580:87bc:d400:7316:ec5d:e57a:90b9]) (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 0F75C69EDB8; Wed, 27 Oct 2021 07:39:06 +0000 (UTC) Date: Wed, 27 Oct 2021 09:39:05 +0200 From: Marc Kleine-Budde To: Vincent Mailhol Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] can: etas_es58x: es58x_rx_err_msg: fix memory leak in error path Message-ID: <20211027073905.aff3mmonp7a3itrn@pengutronix.de> References: <20211026180740.1953265-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="so4fmimmw6kiun32" Content-Disposition: inline In-Reply-To: <20211026180740.1953265-1-mailhol.vincent@wanadoo.fr> 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 --so4fmimmw6kiun32 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > This patch simply removes the return statement in the error branch and > let the function continue. >=20 > * Appendix: how the issue was found * Thanks for the explanation, but I think I'll remove the appendix while applying. 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 | --so4fmimmw6kiun32 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAmF5AhYACgkQqclaivrt 76nlNgf+Nst6/jhatMuQ6s55GqXjlZM4LItQalQjTFtFT8heBKLfM3/CypSNlkGe T5/1RfrQCGnLMMlnk3bbl/01DR5dG8CqnU1wNahQcQydYSe2ApXYE7hgM2ow6NLn wHgtpD8IW30GDyNRDgjv8woi0UUpk52wqz4hsmUE3OhzBhhMHSZ+sydSIIrlwARF 35VDMgHaW8d8FLOLgHkQ84zAnLsvdhe2gDAHSoKHygUcLG1cOQeUuBD9c9Ugq1xD nKIj2fW0i0G8ojCUB1vg45D/SR1oRdgNa+XH08nDOjMR29NM+6ALgQ8zzHza4KF0 1OPX3s4bxeqz6h3bosAZuSR9JxIzOQ== =wcGt -----END PGP SIGNATURE----- --so4fmimmw6kiun32--