lkml.org 
[lkml]   [2020]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tools/bootconfig: Fix apply_xbc() to return zero on success
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>


> 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>

\
 
 \ /
  Last update: 2020-05-09 01:14    [W:0.058 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site