mirror of https://lore.kernel.org/lkml/
 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>,
	Tom Zanussi <tom.zanussi@linux.intel.com>,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: [for-next][PATCH 2/5] tracing: checking for NULL instead of IS_ERR()
Date: Wed, 27 Apr 2016 12:32:29 -0400	[thread overview]
Message-ID: <20160427163250.840121016@goodmis.org> (raw)
In-Reply-To: <20160427163227.271103189@goodmis.org>

[-- Attachment #1: 0002-tracing-checking-for-NULL-instead-of-IS_ERR.patch --]
[-- Type: text/plain, Size: 928 bytes --]

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

tracing_map_elt_alloc() returns ERR_PTRs on error, never NULL.

Fixes: 08d43a5fa063 ('tracing: Add lock-free tracing_map')
Link: http://lkml.kernel.org/r/20160423102347.GA11136@mwanda

Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/tracing_map.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c
index e0f172932eca..e7dfc5eec669 100644
--- a/kernel/trace/tracing_map.c
+++ b/kernel/trace/tracing_map.c
@@ -814,7 +814,7 @@ static struct tracing_map_elt *copy_elt(struct tracing_map_elt *elt)
 	unsigned int i;
 
 	dup_elt = tracing_map_elt_alloc(elt->map);
-	if (!dup_elt)
+	if (IS_ERR(dup_elt))
 		return NULL;
 
 	if (elt->map->ops && elt->map->ops->elt_copy)
-- 
2.8.0.rc3

  parent reply	other threads:[~2016-04-27 16:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-27 16:32 [for-next][PATCH 0/5] tracing: More updates for 4.7 Steven Rostedt
2016-04-27 16:32 ` [for-next][PATCH 1/5] tracing: Do not inherit event-fork option for instances Steven Rostedt
2016-04-27 16:32 ` Steven Rostedt [this message]
2016-04-27 16:32 ` [for-next][PATCH 3/5] tracing: Add check for NULL event field when creating hist field Steven Rostedt
2016-04-27 16:32 ` [for-next][PATCH 4/5] tracing: Handle tracing_map_alloc_elts() error path correctly Steven Rostedt
2016-04-27 16:32 ` [for-next][PATCH 5/5] tracing: Dont use the address of the buffer array name in copy_from_user 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=20160427163250.840121016@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tom.zanussi@linux.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

all inboxes | Powered by JetHome®