mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 02:39:48 +00:00
remoteproc: Check for NULL firmwares in sysfs interface
[ Upstream commit faeadbb640
]
The remoteproc framework provides a sysfs file 'firmware'
for modifying the firmware image name from userspace. Add
an additional check to ensure NULL firmwares are errored
out right away, rather than getting a delayed error while
requesting a firmware during the start of a remoteproc
later on.
Tested-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
5611a2b8a7
commit
d26bd1ce5d
1 changed files with 5 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue