lkml.org 
[lkml]   [2021]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH bpf-next v3 2/2] libbpf: Fix the possible memory leak caused by obj->kconfig
From
Date


On 7/10/21 10:42 PM, Dan Carpenter wrote:
> On Fri, Jul 09, 2021 at 10:47:53AM +0800, Shuyi Cheng wrote:
>> When obj->kconfig is NULL, ERR_PTR(-ENOMEM) should not be returned
>> directly, err=-ENOMEM should be set, and then goto out.
>>
>
> The commit message needs to say what the problem is that the patch is
> fixing. Here is a better commit message:
>
> [PATCH bpf-next v3 2/2] libbpf: Fix the possible memory leak on error
>
> If the strdup() fails then we need to call bpf_object__close(obj) to
> avoid a resource leak.
>
> Add a Fixes tag as well.

Agree, Thanks.

After Andrii reviews the patch, I will resend a new patch.

regards,
Shuyi

>
> regards,
> dan carpenter
>

\
 
 \ /
  Last update: 2021-07-11 03:28    [W:0.053 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site