lkml.org 
[lkml]   [2019]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net: ocelot_board: fix a NULL pointer dereference
From
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.

\
 
 \ /
  Last update: 2019-03-11 18:39    [W:0.382 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site