Messages in this thread | | | Date | Mon, 11 Mar 2019 10:39:39 -0700 (PDT) | Subject | Re: [PATCH] net: ocelot_board: fix a NULL pointer dereference | From | David Miller <> |
| |
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.
| |