From: Suman Anna <s-anna@ti.com>
To: Arnaud Pouliquen <arnaud.pouliquen@st.com>,
Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
Loic Pallardy <loic.pallardy@st.com>,
<linux-remoteproc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/5] remoteproc: Check for NULL firmwares in sysfs interface
Date: Tue, 2 Oct 2018 10:05:58 -0500 [thread overview]
Message-ID: <505f8177-9e27-d864-6355-2bc4171abf47@ti.com> (raw)
In-Reply-To: <a74114d9-e4d6-3f13-add8-2025d0d320f8@st.com>
Hi Arnaud,
On 10/02/2018 04:43 AM, Arnaud Pouliquen wrote:
> Hi Suman,
>
> On 09/15/2018 02:37 AM, Suman Anna wrote:
>> 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.
>>
>> Signed-off-by: Suman Anna <s-anna@ti.com>
>> ---
>> drivers/remoteproc/remoteproc_sysfs.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/remoteproc/remoteproc_sysfs.c b/drivers/remoteproc/remoteproc_sysfs.c
>> index 2142b3ea726e..ce93f4d710f3 100644
>> --- a/drivers/remoteproc/remoteproc_sysfs.c
>> +++ b/drivers/remoteproc/remoteproc_sysfs.c
>> @@ -49,6 +49,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;
>> + }
> This patch fixes only the case of a null name but not a bad name. So I'm
> not one hundred percent sure that it is relevant, as it treats only a
> part of the problem. But it's fine with me if it is accepted.
Yeah, it is a minor fix catching only NULL names. There is no way for
the interface to know a bad name until the corresponding firmware is
requested.
regards
Suman
>
> Tested-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
>
> Regards
> Arnaud
>
>>
>> p = kstrndup(buf, len, GFP_KERNEL);
>> if (!p) {
>>
next prev parent reply other threads:[~2018-10-02 15:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-15 0:37 [PATCH 0/5] remoteproc sysfs fixes/improvements Suman Anna
2018-09-15 0:37 ` [PATCH 1/5] remoteproc: Fix unbalanced boot with sysfs for no auto-boot rprocs Suman Anna
2018-10-02 9:27 ` Arnaud Pouliquen
2018-10-06 6:13 ` Bjorn Andersson
2018-10-08 16:42 ` Suman Anna
2018-09-15 0:37 ` [PATCH 2/5] remoteproc: Check for NULL firmwares in sysfs interface Suman Anna
2018-10-02 9:43 ` Arnaud Pouliquen
2018-10-02 15:05 ` Suman Anna [this message]
2018-10-06 6:14 ` Bjorn Andersson
2018-09-15 0:37 ` [PATCH 3/5] remoteproc: Add missing kernel-doc comment for auto-boot Suman Anna
2018-10-06 6:14 ` Bjorn Andersson
2018-09-15 0:37 ` [PATCH 4/5] remoteproc: Introduce deny_sysfs_ops flag Suman Anna
2018-10-02 9:47 ` Arnaud Pouliquen
2018-10-02 15:14 ` Suman Anna
2018-09-15 0:37 ` [PATCH 5/5] remoteproc/wkup_m3: Set " Suman Anna
2018-10-01 21:11 ` [PATCH 0/5] remoteproc sysfs fixes/improvements Suman Anna
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=505f8177-9e27-d864-6355-2bc4171abf47@ti.com \
--to=s-anna@ti.com \
--cc=arnaud.pouliquen@st.com \
--cc=bjorn.andersson@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=loic.pallardy@st.com \
--cc=ohad@wizery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).