aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/symbol.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-02-17 03:38:31 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-03-02 00:26:47 +0900
commitcd81fc82b93fa408c30e08f59e5ef8caaa91d1d2 (patch)
tree5c6024076d70c2a392fb3207d6ba737ef7e5843b /scripts/kconfig/symbol.c
parentkbuild: disable sparse warnings about unknown attributes (diff)
downloadlinux-dev-cd81fc82b93fa408c30e08f59e5ef8caaa91d1d2.tar.xz
linux-dev-cd81fc82b93fa408c30e08f59e5ef8caaa91d1d2.zip
kconfig: add xstrdup() helper
We already have xmalloc(), xcalloc(), and xrealloc((). Add xstrdup() as well to save tedious error handling. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/kconfig/symbol.c')
-rw-r--r--scripts/kconfig/symbol.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index cca9663be5dd..2220bc4b051b 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -183,7 +183,7 @@ static void sym_validate_range(struct symbol *sym)
sprintf(str, "%lld", val2);
else
sprintf(str, "0x%llx", val2);
- sym->curr.val = strdup(str);
+ sym->curr.val = xstrdup(str);
}
static void sym_set_changed(struct symbol *sym)
@@ -849,7 +849,7 @@ struct symbol *sym_lookup(const char *name, int flags)
: !(symbol->flags & (SYMBOL_CONST|SYMBOL_CHOICE))))
return symbol;
}
- new_name = strdup(name);
+ new_name = xstrdup(name);
} else {
new_name = NULL;
hash = 0;