linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: alexandre.belloni@bootlin.com, kjlu@umn.edu, pakki001@umn.edu,
	UNGLinuxDriver@microchip.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: ocelot_board: fix a NULL pointer dereference
Date: Mon, 11 Mar 2019 10:39:39 -0700 (PDT)	[thread overview]
Message-ID: <20190311.103939.277829855981067209.davem@davemloft.net> (raw)
In-Reply-To: <d61f3d5e-6f8c-5a44-447a-7fc96cb65037@gmail.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 11 Mar 2019 07:14:58 -0700

> 
> 
> On 03/11/2019 03:26 AM, Alexandre Belloni wrote:
>> On 11/03/2019 01:36:32-0500, Kangjie Lu wrote:
>>> In case devm_kcalloc fails, the fix returns -ENOMEM to avoid
>>> NULL pointer dereference.
>>>
>>> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
>> Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
>> 
> 
> A proper error path is needed to avoid memory leaks.

This seems to be a major chronic problem with all of these patches.

Kangjie please put more care into the patches you are submitting.

You absolutely CANNOT just add a error check and return, you must
handle releasing resources and any other necessary cleanups.

  reply	other threads:[~2019-03-11 17:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11  6:36 [PATCH] net: ocelot_board: fix a NULL pointer dereference Kangjie Lu
2019-03-11 10:26 ` Alexandre Belloni
2019-03-11 14:14   ` Eric Dumazet
2019-03-11 17:39     ` David Miller [this message]
2019-03-23  3:33     ` Kangjie Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190311.103939.277829855981067209.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=eric.dumazet@gmail.com \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pakki001@umn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).