]> git.itanic.dy.fi Git - linux-stable/commitdiff
kconfig: remove error check for xrealloc()
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 18 Nov 2023 06:18:36 +0000 (15:18 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Tue, 28 Nov 2023 02:22:51 +0000 (11:22 +0900)
xrealloc() never returns NULL as it is checked in the callee.

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

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/confdata.c

index 7fca9cc3ae748911eff76677421d744e079278fa..2ba4dfdd1aeeea159a140379af5478a5f51a1619 100644 (file)
@@ -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;
        }