Skip to contentSkip to conversation

binfmt: check return value of remove_arg_zero

PATCH New Olaf Hering 1 participant 1 message Mar 19, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 binfmt: check return value of remove_arg_zero

In preparation to build with -Werror=unused-result, use remove_arg_zero properly.

Fixes commit b6a2fea39318e43fee84fa7b0b90d68bed92d2ba

---
 fs/binfmt_em86.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/binfmt_em86.c +2 -1
index 06b9b9fddf70..5b1c02a0250f 100644
@@ -63,7 +63,8 @@ static int load_em86(struct linux_binprm *bprm)
 	 * This is done in reverse order, because of how the
 	 * user environment and arguments are stored.
 	 */
-	remove_arg_zero(bprm);
+	retval = remove_arg_zero(bprm);
+	if (retval < 0) return retval; 
 	retval = copy_string_kernel(bprm->filename, bprm);
 	if (retval < 0) return retval; 
 	bprm->argc++;