From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Suman Anna <s-anna@ti.com>, Xiang Xiao <xiaoxiang781216@gmail.com>
Cc: linux-remoteproc@vger.kernel.org, Xiang Xiao <xiaoxiang@xiaomi.com>
Subject: Re: [PATCH] remoteproc: debug: remove strlen call in rproc_trace_read
Date: Wed, 7 Nov 2018 22:13:55 -0800 [thread overview]
Message-ID: <20181108061355.GX12063@builder> (raw)
In-Reply-To: <1541603184-26652-1-git-send-email-xiaoxiang@xiaomi.com>
On Wed 07 Nov 07:06 PST 2018, Xiang Xiao wrote:
> because the trace buffer may contain the binary data
>
I think this patch is good.
@Suman, as I know you're using this and would now read past the first \0
in the buffer, do you have any objections to it?
Regards,
Bjorn
> Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
> ---
> drivers/remoteproc/remoteproc_debugfs.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c
> index e90135c..0808466 100644
> --- a/drivers/remoteproc/remoteproc_debugfs.c
> +++ b/drivers/remoteproc/remoteproc_debugfs.c
> @@ -48,9 +48,8 @@ static ssize_t rproc_trace_read(struct file *filp, char __user *userbuf,
> size_t count, loff_t *ppos)
> {
> struct rproc_mem_entry *trace = filp->private_data;
> - int len = strnlen(trace->va, trace->len);
>
> - return simple_read_from_buffer(userbuf, count, ppos, trace->va, len);
> + return simple_read_from_buffer(userbuf, count, ppos, trace->va, trace->len);
> }
>
> static const struct file_operations trace_rproc_ops = {
> --
> 2.7.4
>
next prev parent reply other threads:[~2018-11-08 6:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-07 15:06 [PATCH] remoteproc: debug: remove strlen call in rproc_trace_read Xiang Xiao
2018-11-08 6:13 ` Bjorn Andersson [this message]
2018-11-08 8:10 ` Loic PALLARDY
2018-11-08 10:08 ` xiang xiao
2018-11-08 21:01 ` Loic PALLARDY
2018-11-09 8:13 ` xiang xiao
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=20181108061355.GX12063@builder \
--to=bjorn.andersson@linaro.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=s-anna@ti.com \
--cc=xiaoxiang781216@gmail.com \
--cc=xiaoxiang@xiaomi.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