From: Neil Horman It would be nice if the argv_split library function could gracefully handle a NULL pointer in the argcp parameter, so as to allow functions using it that did not care about the value of argc to not have to declare a useless variable. This patch accomplishes that. Tested by me, with successful results. Signed-off-by: Neil Horman Acked-by: Jeremy Fitzhardinge Cc: Satyam Sharma Signed-off-by: Andrew Morton --- lib/argv_split.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) diff -puN lib/argv_split.c~argv_split-allow-argv_split-to-handle-null-pointer-in-argcp-parameter-gracefully lib/argv_split.c --- a/lib/argv_split.c~argv_split-allow-argv_split-to-handle-null-pointer-in-argcp-parameter-gracefully +++ a/lib/argv_split.c @@ -75,7 +75,9 @@ char **argv_split(gfp_t gfp, const char if (argv == NULL) goto out; - *argcp = argc; + if (argcp) + *argcp = argc; + argvp = argv; while (*str) { _