From: Namhyung Kim <namhyung@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: <zhengjun.xing@intel.com>, <mingo@redhat.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tracing: Add *iter check for NULL
Date: Mon, 20 Jun 2016 09:12:51 +0900 [thread overview]
Message-ID: <20160620001250.GB25962@sejong> (raw)
In-Reply-To: <20160617142457.48a37b6c@gandalf.local.home>
On Fri, Jun 17, 2016 at 02:24:57PM -0400, Steven Rostedt wrote:
> I tried your patch and it works until you remove the module and try
> reading the trace again. As I said, you left out later processing. This
> should not exit on error. Below is a patch I wrote, and it works well.
>
> I'll add you as reported by.
>
> Thanks!
Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks,
Namhyung
> diff --git a/kernel/trace/trace_printk.c b/kernel/trace/trace_printk.c
> index f96f0383f6c6..ad1d6164e946 100644
> --- a/kernel/trace/trace_printk.c
> +++ b/kernel/trace/trace_printk.c
> @@ -36,6 +36,10 @@ struct trace_bprintk_fmt {
> static inline struct trace_bprintk_fmt *lookup_format(const char *fmt)
> {
> struct trace_bprintk_fmt *pos;
> +
> + if (!fmt)
> + return ERR_PTR(-EINVAL);
> +
> list_for_each_entry(pos, &trace_bprintk_fmt_list, list) {
> if (!strcmp(pos->fmt, fmt))
> return pos;
> @@ -57,7 +61,8 @@ void hold_module_trace_bprintk_format(const char **start, const char **end)
> for (iter = start; iter < end; iter++) {
> struct trace_bprintk_fmt *tb_fmt = lookup_format(*iter);
> if (tb_fmt) {
> - *iter = tb_fmt->fmt;
> + if (!IS_ERR(tb_fmt))
> + *iter = tb_fmt->fmt;
> continue;
> }
>
prev parent reply other threads:[~2016-06-20 0:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-01 8:31 [PATCH] tracing: Add *iter check for NULL zhengjun.xing
2016-06-02 15:41 ` Namhyung Kim
2016-06-17 16:38 ` Steven Rostedt
2016-06-17 18:24 ` Steven Rostedt
2016-06-20 0:12 ` Namhyung Kim [this message]
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=20160620001250.GB25962@sejong \
--to=namhyung@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=zhengjun.xing@intel.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