All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] tools/bootconfig: Fix error return code in apply_xbc()
@ 2021-05-08  3:42 Zhen Lei
  2021-05-14 22:32 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Zhen Lei @ 2021-05-08  3:42 UTC (permalink / raw)
  To: Masami Hiramatsu, Steven Rostedt, linux-kernel; +Cc: Zhen Lei

Fix to return a negative error code from the error handling case instead
of 0, as done elsewhere in this function.

Fixes: a995e6bc0524 ("tools/bootconfig: Fix to check the write failure correctly")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 tools/bootconfig/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
index 7362bef1a368..6cd6080cac04 100644
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -399,6 +399,7 @@ static int apply_xbc(const char *path, const char *xbc_path)
 	}
 	/* TODO: Ensure the @path is initramfs/initrd image */
 	if (fstat(fd, &stat) < 0) {
+		ret = -errno;
 		pr_err("Failed to get the size of %s\n", path);
 		goto out;
 	}
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] tools/bootconfig: Fix error return code in apply_xbc()
  2021-05-08  3:42 [PATCH 1/1] tools/bootconfig: Fix error return code in apply_xbc() Zhen Lei
@ 2021-05-14 22:32 ` Steven Rostedt
  2021-05-23 14:19   ` Masami Hiramatsu
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2021-05-14 22:32 UTC (permalink / raw)
  To: Zhen Lei; +Cc: Masami Hiramatsu, linux-kernel

On Sat, 8 May 2021 11:42:16 +0800
Zhen Lei <thunder.leizhen@huawei.com> wrote:

> Fix to return a negative error code from the error handling case instead
> of 0, as done elsewhere in this function.
> 
> Fixes: a995e6bc0524 ("tools/bootconfig: Fix to check the write failure correctly")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

Masami, care to ack this?

-- Steve

> ---
>  tools/bootconfig/main.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
> index 7362bef1a368..6cd6080cac04 100644
> --- a/tools/bootconfig/main.c
> +++ b/tools/bootconfig/main.c
> @@ -399,6 +399,7 @@ static int apply_xbc(const char *path, const char *xbc_path)
>  	}
>  	/* TODO: Ensure the @path is initramfs/initrd image */
>  	if (fstat(fd, &stat) < 0) {
> +		ret = -errno;
>  		pr_err("Failed to get the size of %s\n", path);
>  		goto out;
>  	}


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] tools/bootconfig: Fix error return code in apply_xbc()
  2021-05-14 22:32 ` Steven Rostedt
@ 2021-05-23 14:19   ` Masami Hiramatsu
  0 siblings, 0 replies; 3+ messages in thread
From: Masami Hiramatsu @ 2021-05-23 14:19 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Zhen Lei, Masami Hiramatsu, linux-kernel

On Fri, 14 May 2021 18:32:38 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Sat, 8 May 2021 11:42:16 +0800
> Zhen Lei <thunder.leizhen@huawei.com> wrote:
> 
> > Fix to return a negative error code from the error handling case instead
> > of 0, as done elsewhere in this function.
> > 
> > Fixes: a995e6bc0524 ("tools/bootconfig: Fix to check the write failure correctly")
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> 
> Masami, care to ack this?

Oops, I missed this patch. Sorry.

This looks good to me.

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Thank you!

> 
> -- Steve
> 
> > ---
> >  tools/bootconfig/main.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
> > index 7362bef1a368..6cd6080cac04 100644
> > --- a/tools/bootconfig/main.c
> > +++ b/tools/bootconfig/main.c
> > @@ -399,6 +399,7 @@ static int apply_xbc(const char *path, const char *xbc_path)
> >  	}
> >  	/* TODO: Ensure the @path is initramfs/initrd image */
> >  	if (fstat(fd, &stat) < 0) {
> > +		ret = -errno;
> >  		pr_err("Failed to get the size of %s\n", path);
> >  		goto out;
> >  	}
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-23 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-08  3:42 [PATCH 1/1] tools/bootconfig: Fix error return code in apply_xbc() Zhen Lei
2021-05-14 22:32 ` Steven Rostedt
2021-05-23 14:19   ` Masami Hiramatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.