Skip to content

Commit

Permalink
kconfig: remove error check for xrealloc()
Browse files Browse the repository at this point in the history
xrealloc() never returns NULL as it is checked in the callee.

This is a left-over of commit d717f24 ("kconfig: add xrealloc()
helper").

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
  • Loading branch information
Masahiro Yamada committed Nov 28, 2023
1 parent 259b8bd commit 61e3e3c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions scripts/kconfig/confdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,16 +289,12 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
#define LINE_GROWTH 16
static int add_byte(int c, char **lineptr, size_t slen, size_t *n)
{
char *nline;
size_t new_size = slen + 1;

if (new_size > *n) {
new_size += LINE_GROWTH - 1;
new_size *= 2;
nline = xrealloc(*lineptr, new_size);
if (!nline)
return -1;

*lineptr = nline;
*lineptr = xrealloc(*lineptr, new_size);
*n = new_size;
}

Expand Down

0 comments on commit 61e3e3c

Please sign in to comment.