linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: [for-next][PATCH 12/14] tracing/boot: Fix an IS_ERR() vs NULL bug
Date: Fri, 24 Jan 2020 10:17:03 -0500	[thread overview]
Message-ID: <20200124151725.996608776@goodmis.org> (raw)
In-Reply-To: 20200124151651.852781301@goodmis.org

From: Dan Carpenter <dan.carpenter@oracle.com>

The trace_array_get_by_name() function doesn't return error pointers,
it returns NULL on error.

Link: http://lkml.kernel.org/r/20200117053007.5h2juv272pokqhtq@kili.mountain

Fixes: 4f712a4d04a4 ("tracing/boot: Add instance node support")
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/trace/trace_boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c
index fa9603dc6469..cd541ac1cbc1 100644
--- a/kernel/trace/trace_boot.c
+++ b/kernel/trace/trace_boot.c
@@ -322,7 +322,7 @@ trace_boot_init_instances(struct xbc_node *node)
 			continue;
 
 		tr = trace_array_get_by_name(p);
-		if (IS_ERR(tr)) {
+		if (!tr) {
 			pr_err("Failed to get trace instance %s\n", p);
 			continue;
 		}
-- 
2.24.1



  parent reply	other threads:[~2020-01-24 15:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 15:16 [for-next][PATCH 00/14] tracing: More updates for 5.6 Steven Rostedt
2020-01-24 15:16 ` [for-next][PATCH 01/14] ring-bufer: kernel-doc warning fixes Steven Rostedt
2020-01-24 15:16 ` [for-next][PATCH 02/14] ring-buffer: Fix kernel doc for rb_update_event() Steven Rostedt
2020-01-24 15:16 ` [for-next][PATCH 03/14] tracing: Allow trace_printk() to nest in other tracing code Steven Rostedt
2020-01-24 15:16 ` [for-next][PATCH 04/14] ftrace: Remove abandoned macros Steven Rostedt
2020-01-24 15:16 ` [for-next][PATCH 05/14] ftrace: Remove NR_TO_INIT macro Steven Rostedt
2020-01-24 15:16 ` [for-next][PATCH 06/14] bootconfig: Fix Kconfig help message for BOOT_CONFIG Steven Rostedt
2020-01-24 15:16 ` [for-next][PATCH 07/14] Documentation: bootconfig: Fix typos in bootconfig documentation Steven Rostedt
2020-01-24 15:16 ` [for-next][PATCH 08/14] Documentation: tracing: Fix typos in boot-time tracing documentation Steven Rostedt
2020-01-24 15:17 ` [for-next][PATCH 09/14] tools: bootconfig: Fix spelling mistake "faile" -> "failed" Steven Rostedt
2020-01-24 15:17 ` [for-next][PATCH 10/14] ring-buffer: Remove abandoned macro RB_MISSED_FLAGS Steven Rostedt
2020-01-24 15:17 ` [for-next][PATCH 11/14] tracing: Remove unused TRACE_SEQ_BUF_USED Steven Rostedt
2020-01-24 15:17 ` Steven Rostedt [this message]
2020-01-24 15:17 ` [for-next][PATCH 13/14] tracing: Fix uninitialized buffer var on early exit to trace_vbprintk() Steven Rostedt
2020-01-24 15:17 ` [for-next][PATCH 14/14] trace/kprobe: Remove unused MAX_KPROBE_CMDLINE_SIZE Steven Rostedt

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=20200124151725.996608776@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    /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).