From 1f2f65c41034accf9baf684c0dae756b56fac19f Mon Sep 17 00:00:00 2001 From: Alex Elder Date: Fri, 28 Feb 2020 12:33:59 -0600 Subject: [PATCH] remoteproc: return error for bad "recovery" debugfs input If the value written to the "recovery" debugfs file is not one of the recognized commands return an error to indicate it's invalid. Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20200228183359.16229-5-elder@linaro.org Signed-off-by: Bjorn Andersson --- drivers/remoteproc/remoteproc_debugfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c index b87565a..d734cad 100644 --- a/drivers/remoteproc/remoteproc_debugfs.c +++ b/drivers/remoteproc/remoteproc_debugfs.c @@ -146,6 +146,8 @@ rproc_recovery_write(struct file *filp, const char __user *user_buf, } else if (!strncmp(buf, "recover", count)) { /* begin the recovery process without changing the flag */ rproc_trigger_recovery(rproc); + } else { + return -EINVAL; } return count; -- 2.7.4