Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1763969pxb; Fri, 5 Feb 2021 00:22:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRy/76fY+U19nY47YdPT1XCWUlzmndJ4wMgMMOnUCzkBN9MoJA9Jts/s45ObJO9Jj+9aYV X-Received: by 2002:aa7:dd57:: with SMTP id o23mr2488146edw.252.1612513324910; Fri, 05 Feb 2021 00:22:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612513324; cv=none; d=google.com; s=arc-20160816; b=pt8LMlPiekRtmmjlXYjOTrmzH8Bi62P2B7pmWMfk2x4U4QCxI0YOuYA1tn6jSSoFC6 3lmpfpsNjFbllQ/mvh3DlBHmBSz2lnYmIxtesRGsevlYttomgz2qap3+NV0jUM8WbHNf DcmMimt8VTMmCjJDjsxaRBBu1Pp0oaZSBuYuiOISKlbT5RA2O38peHwhL8kGyYwE0mpd 1cZ+ClaGjtAC6E6GbKER0/vICEOKgQLTxdgjEsH2ZIC759UwZbGX4XHTabEjtAvu8poW IilNdu0581N7QnExuF+5d9Cvz88tj6Bwf5WOxKX79J/a2dMcyFkHvJbmjaM71pV6iuuA LCxw== 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=QftocehrhY0lyIQLHXvRUbWn0bknSq+lm6v2dXVcrOY=; b=YJyg5L7papjJOd9T5i43QYQpeWYSAbHmBvhutmxKrzMxvNWqhQvpdwDuP2yQrY/fqJ akU6iAfesyAj8u10Y/FBCJB3vYfzCmaWZg0VEjDOUkVndQf+9mk5oH4BKY0fKUK5YCwA pf/x0Emq1MxMfmkhyvMfo+VymlmlCqF/pClEZirAXYNSDBMmQAT7xuGw2a6Mz0rnhv63 V4Ilmugq/BZXGo0e/ZamjKiW8xVKdMFVWWcjqb9kdNl/tBQ1fXMUMO5MKcBOhQ/xjAqu 50EMK9+kJvt9xAbZqzFB4lxrfc4ZIHoUFGlOAIrTqRX7GZyIvdwetUTMyPlfHwm4q2Nl EAog== 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 he18si1026389ejc.699.2021.02.05.00.21.40; Fri, 05 Feb 2021 00:22:04 -0800 (PST) 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 S231438AbhBEIU0 (ORCPT + 99 others); Fri, 5 Feb 2021 03:20:26 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:57127 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231613AbhBEIUD (ORCPT ); Fri, 5 Feb 2021 03:20:03 -0500 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 1l7wKg-0000N3-Q1; Fri, 05 Feb 2021 09:19:14 +0100 Received: from hardanger.blackshift.org (unknown [IPv6:2a03:f580:87bc:d400:8f9f:ac65:660b:ab5f]) (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 D5C875D727A; Fri, 5 Feb 2021 08:19:11 +0000 (UTC) Date: Fri, 5 Feb 2021 09:19:11 +0100 From: Marc Kleine-Budde To: Xulin Sun Cc: wg@grandegger.com, dmurphy@ti.com, sriram.dash@samsung.com, kuba@kernel.org, davem@davemloft.net, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, xulinsun@gmail.com Subject: Re: [PATCH 2/2] can: m_can: m_can_class_allocate_dev(): remove impossible error return judgment Message-ID: <20210205081911.4xvabbzdtkvkpplq@hardanger.blackshift.org> References: <20210205072559.13241-1-xulin.sun@windriver.com> <20210205072559.13241-2-xulin.sun@windriver.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qc4ism5jczzmdofu" Content-Disposition: inline In-Reply-To: <20210205072559.13241-2-xulin.sun@windriver.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --qc4ism5jczzmdofu Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 05.02.2021 15:25:59, Xulin Sun wrote: > If the previous can_net device has been successfully allocated, its > private data structure is impossible to be empty, remove this redundant > error return judgment. Otherwise, memory leaks for alloc_candev() will > be triggered. Your analysis is correct, the netdev_priv() will never fail. But how will this trigger a mem leak on alloc_candev()? I've removed that statement. I'll add it back, if I've missed something. > Signed-off-by: Xulin Sun Applied to linux-can-next/testing. 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 | --qc4ism5jczzmdofu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAmAc/3wACgkQqclaivrt 76lp7wf+NhRkk+GC8Jw8tp95kPP8BRbv03JY3AbOsFUkoyIO6FiIXKsJ3deH/Mz+ nYWq5nVAZLOxwB1leQp6VD4dAd8GUmKZ7p04MkIpG+kqo860F7FZTrIcwWkHId/M Y7nuNOS+EffNS9Cr0pkOHNEk8CTRdx6ft4FjP9p683ZyJeAflGFL5dbz3VxiDNCO slss4QrTnqylCgrtToI2C/0m5eWPX3Cf8ns9HkKfy57Z6gbkv6R6Yi0dcfOF8FBV c2nLLpW/Nu9LGLqecBPvsQUkN/z2S0B3LQbWOOC7EdBgz2s27XncPv4LdaaUD08V /qpaOKF4r/Z0ua4Q5IvleS8jj0TJyA== =WwKn -----END PGP SIGNATURE----- --qc4ism5jczzmdofu--