Skip to contentSkip to conversation

fs: binfmt_em86: check the result of remove_arg_zero()

PATCH New Masahiro Yamada 1 participant 1 message Dec 21, 2020

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

PATCH 1/1 fs: binfmt_em86: check the result of remove_arg_zero()

Fix the following warning:

fs/binfmt_em86.c: In function 'load_em86':
fs/binfmt_em86.c:66:2: warning: ignoring return value of 'remove_arg_zero', declared with attribute warn_unused_result [-Wunused-result] 66 |  remove_arg_zero(bprm);
      |  ^~~~~~~~~~~~~~~~~~~~~

---

 fs/binfmt_em86.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/binfmt_em86.c +3 -1
index 06b9b9fddf70..ba1e22b2e2a3 100644
@@ -63,7 +63,9 @@ 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)
+		return retval;
 	retval = copy_string_kernel(bprm->filename, bprm);
 	if (retval < 0) return retval; 
 	bprm->argc++;
Signature · 1 line
2.27.0