[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190311.103939.277829855981067209.davem@davemloft.net>
Date: Mon, 11 Mar 2019 10:39:39 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: alexandre.belloni@...tlin.com, kjlu@....edu, pakki001@....edu,
UNGLinuxDriver@...rochip.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: ocelot_board: fix a NULL pointer dereference
From: Eric Dumazet <eric.dumazet@...il.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@....edu>
>> Reviewed-by: Alexandre Belloni <alexandre.belloni@...tlin.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.
Powered by blists - more mailing lists