summaryrefslogtreecommitdiff
path: root/drivers/remoteproc/remoteproc_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/remoteproc/remoteproc_sysfs.c')
-rw-r--r--drivers/remoteproc/remoteproc_sysfs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/remoteproc/remoteproc_sysfs.c b/drivers/remoteproc/remoteproc_sysfs.c
index 47be411400e5..3a4c3d7cafca 100644
--- a/drivers/remoteproc/remoteproc_sysfs.c
+++ b/drivers/remoteproc/remoteproc_sysfs.c
@@ -48,6 +48,11 @@ static ssize_t firmware_store(struct device *dev,
}
len = strcspn(buf, "\n");
+ if (!len) {
+ dev_err(dev, "can't provide a NULL firmware\n");
+ err = -EINVAL;
+ goto out;
+ }
p = kstrndup(buf, len, GFP_KERNEL);
if (!p) {