From: Dan Carpenter <dan.carpenter@oracle•com>
To: Shuyi Cheng <chengshuyi@linux•alibaba.com>
Cc: ast@kernel•org, daniel@iogearbox•net, andrii@kernel•org,
kafai@fb•com, songliubraving@fb•com, yhs@fb•com,
john.fastabend@gmail•com, kpsingh@kernel•org,
netdev@vger•kernel.org, bpf@vger•kernel.org,
linux-kernel@vger•kernel.org, kernel-janitors@vger•kernel.org
Subject: Re: [PATCH bpf-next v3 2/2] libbpf: Fix the possible memory leak caused by obj->kconfig
Date: Sat, 10 Jul 2021 17:42:48 +0300 [thread overview]
Message-ID: <20210710144248.GA1931@kadam> (raw)
In-Reply-To: <1625798873-55442-3-git-send-email-chengshuyi@linux.alibaba.com>
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.
regards,
dan carpenter
next prev parent reply other threads:[~2021-07-10 14:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-09 2:47 [PATCH bpf-next v3 0/2] libbpf: Introduce 'btf_custom_path' to 'bpf_obj_open_opts' Shuyi Cheng
2021-07-09 2:47 ` [PATCH bpf-next v3 1/2] " Shuyi Cheng
2021-07-12 23:53 ` Andrii Nakryiko
2021-07-09 2:47 ` [PATCH bpf-next v3 2/2] libbpf: Fix the possible memory leak caused by obj->kconfig Shuyi Cheng
2021-07-10 14:42 ` Dan Carpenter [this message]
2021-07-11 1:27 ` Shuyi Cheng
2021-07-13 0:01 ` [PATCH bpf-next v3 0/2] libbpf: Introduce 'btf_custom_path' to 'bpf_obj_open_opts' Andrii Nakryiko
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=20210710144248.GA1931@kadam \
--to=dan.carpenter@oracle$(echo .)com \
--cc=andrii@kernel$(echo .)org \
--cc=ast@kernel$(echo .)org \
--cc=bpf@vger$(echo .)kernel.org \
--cc=chengshuyi@linux$(echo .)alibaba.com \
--cc=daniel@iogearbox$(echo .)net \
--cc=john.fastabend@gmail$(echo .)com \
--cc=kafai@fb$(echo .)com \
--cc=kernel-janitors@vger$(echo .)kernel.org \
--cc=kpsingh@kernel$(echo .)org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=songliubraving@fb$(echo .)com \
--cc=yhs@fb$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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