[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200509091107.eb4f517a93ff2e0ae5e64b93@kernel.org>
Date: Sat, 9 May 2020 09:11:07 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Steven Rostedt <rostedt@...dmis.org>,
LKML <linux-kernel@...r.kernel.org>,
Dan Carpenter <dan.carpenter@...cle.com>,
Yunfeng Ye <yeyunfeng@...wei.com>,
Shiyuan Hu <hushiyuan@...wei.com>,
Hewenliang <hewenliang4@...wei.com>
Subject: Re: [PATCH] tools/bootconfig: Fix apply_xbc() to return zero on
success
On Sat, 9 May 2020 08:14:24 +0900
Masami Hiramatsu <mhiramat@...nel.org> wrote:
> On Fri, 8 May 2020 11:13:49 -0400
> Steven Rostedt <rostedt@...dmis.org> wrote:
>
> > From: "Steven Rostedt (VMware)" <rostedt@...dmis.org>
> >
> > The return of apply_xbc() returns the result of the last write() call, which
> > is not what is expected. It should only return zero on success.
> >
> > Link: https://lore.kernel.org/r/20200508093059.GF9365@kadam
> >
>
> Thanks for fixing!
>
> Acked-by: Masami Hiramatsu <mhiramat@...nel.org>
>
Oh, and tested too.
---
...
test case 40 (samples/good-tree.bconf)...
Apply samples/good-tree.bconf to ./initrd-tNhd
Number of nodes: 16
Size: 136 bytes
Checksum: 9171
[OK]
All tests passed
---
Tested-by: Masami Hiramatsu <mhiramat@...nel.org>
BTW, I might better add a test summary to the test script (and move it
into kselftest?)
Thank you,
>
> > Fixes: 8842604446d1 ("tools/bootconfig: Fix resource leak in apply_xbc()")
> > Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
> > Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
> > ---
> > tools/bootconfig/main.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
> > index 001076c51712..0efaf45f7367 100644
> > --- a/tools/bootconfig/main.c
> > +++ b/tools/bootconfig/main.c
> > @@ -337,6 +337,7 @@ int apply_xbc(const char *path, const char *xbc_path)
> > pr_err("Failed to apply a boot config magic: %d\n", ret);
> > goto out;
> > }
> > + ret = 0;
> > out:
> > close(fd);
> > free(data);
> > --
> > 2.20.1
> >
>
>
> --
> Masami Hiramatsu <mhiramat@...nel.org>
--
Masami Hiramatsu <mhiramat@...nel.org>
Powered by blists - more mailing lists