Commit 61e3e3c2 authored by Masahiro Yamada's avatar Masahiro Yamada

kconfig: remove error check for xrealloc()

xrealloc() never returns NULL as it is checked in the callee.

This is a left-over of commit d717f24d ("kconfig: add xrealloc()
helper").
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 259b8bd1
...@@ -289,16 +289,12 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) ...@@ -289,16 +289,12 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
#define LINE_GROWTH 16 #define LINE_GROWTH 16
static int add_byte(int c, char **lineptr, size_t slen, size_t *n) static int add_byte(int c, char **lineptr, size_t slen, size_t *n)
{ {
char *nline;
size_t new_size = slen + 1; size_t new_size = slen + 1;
if (new_size > *n) { if (new_size > *n) {
new_size += LINE_GROWTH - 1; new_size += LINE_GROWTH - 1;
new_size *= 2; new_size *= 2;
nline = xrealloc(*lineptr, new_size); *lineptr = xrealloc(*lineptr, new_size);
if (!nline)
return -1;
*lineptr = nline;
*n = new_size; *n = new_size;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment