mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
kconfig: remove redundant NULL pointer check before free()
Passing NULL to free() is allowed and is a no-op. Remove redundant NULL pointer checks. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
parent
9ad86d747c
commit
407868deb2
@ -432,8 +432,7 @@ int conf_read_simple(const char *name, int def)
|
||||
case S_INT:
|
||||
case S_HEX:
|
||||
case S_STRING:
|
||||
if (sym->def[def].val)
|
||||
free(sym->def[def].val);
|
||||
free(sym->def[def].val);
|
||||
/* fall through */
|
||||
default:
|
||||
sym->def[def].val = NULL;
|
||||
|
@ -42,8 +42,7 @@ struct gstr str_new(void)
|
||||
/* Free storage for growable string */
|
||||
void str_free(struct gstr *gs)
|
||||
{
|
||||
if (gs->s)
|
||||
free(gs->s);
|
||||
free(gs->s);
|
||||
gs->s = NULL;
|
||||
gs->len = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user