mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-01 22:37:41 -04:00
Merge tag 'bootconfig-fixes-v7.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull bootconfig fixes from Masami Hiramatsu: - Check error code of xbc_init_node() in override value path in xbc_parse_kv() - Fix fd leak in load_xbc_file() on fstat failure * tag 'bootconfig-fixes-v7.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tools/bootconfig: fix fd leak in load_xbc_file() on fstat failure lib/bootconfig: check xbc_init_node() return in override path
This commit is contained in:
@@ -723,7 +723,8 @@ static int __init xbc_parse_kv(char **k, char *v, int op)
|
||||
if (op == ':') {
|
||||
unsigned short nidx = child->next;
|
||||
|
||||
xbc_init_node(child, v, XBC_VALUE);
|
||||
if (xbc_init_node(child, v, XBC_VALUE) < 0)
|
||||
return xbc_parse_error("Failed to override value", v);
|
||||
child->next = nidx; /* keep subkeys */
|
||||
goto array;
|
||||
}
|
||||
|
||||
@@ -162,8 +162,11 @@ static int load_xbc_file(const char *path, char **buf)
|
||||
if (fd < 0)
|
||||
return -errno;
|
||||
ret = fstat(fd, &stat);
|
||||
if (ret < 0)
|
||||
return -errno;
|
||||
if (ret < 0) {
|
||||
ret = -errno;
|
||||
close(fd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = load_xbc_fd(fd, buf, stat.st_size);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user