Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+2 -4
+1 -2
scripts/kconfig/confdata.c
··· 432 432 case S_INT: 433 433 case S_HEX: 434 434 case S_STRING: 435 - if (sym->def[def].val) 436 - free(sym->def[def].val); 435 + free(sym->def[def].val); 437 436 /* fall through */ 438 437 default: 439 438 sym->def[def].val = NULL;
+1 -2
scripts/kconfig/util.c
··· 42 42 /* Free storage for growable string */ 43 43 void str_free(struct gstr *gs) 44 44 { 45 - if (gs->s) 46 - free(gs->s); 45 + free(gs->s); 47 46 gs->s = NULL; 48 47 gs->len = 0; 49 48 }