linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Yunfeng Ye <yeyunfeng@huawei.com>,
	Shiyuan Hu <hushiyuan@huawei.com>,
	Hewenliang <hewenliang4@huawei.com>
Subject: Re: [PATCH] tools/bootconfig: Fix apply_xbc() to return zero on success
Date: Sat, 9 May 2020 09:11:07 +0900	[thread overview]
Message-ID: <20200509091107.eb4f517a93ff2e0ae5e64b93@kernel.org> (raw)
In-Reply-To: <20200509081424.7d0d21270f1725b5cf9a8535@kernel.org>

On Sat, 9 May 2020 08:14:24 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> On Fri, 8 May 2020 11:13:49 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
> 
> > From: "Steven Rostedt (VMware)" <rostedt@goodmis.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@kernel.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@kernel.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@oracle.com>
> > Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.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@kernel.org>


-- 
Masami Hiramatsu <mhiramat@kernel.org>

  reply	other threads:[~2020-05-09  0:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08 15:13 [PATCH] tools/bootconfig: Fix apply_xbc() to return zero on success Steven Rostedt
2020-05-08 23:14 ` Masami Hiramatsu
2020-05-09  0:11   ` Masami Hiramatsu [this message]
2020-05-09  0:58     ` [PATCH] tools/bootconfig: Add a summary of test cases and return error Masami Hiramatsu

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=20200509091107.eb4f517a93ff2e0ae5e64b93@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=hewenliang4@huawei.com \
    --cc=hushiyuan@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=yeyunfeng@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).