All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] tracing: checking for NULL instead of IS_ERR()
@ 2016-04-23 10:23 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2016-04-23 10:23 UTC (permalink / raw)
  To: Steven Rostedt, Tom Zanussi; +Cc: Ingo Molnar, linux-kernel, kernel-janitors

tracing_map_elt_alloc() returns ERR_PTRs on error, never NULL.

Fixes: 08d43a5fa063 ('tracing: Add lock-free tracing_map')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c
index e0f1729..e7dfc5e 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)

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-04-26 13:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-23 10:23 [patch] tracing: checking for NULL instead of IS_ERR() Dan Carpenter
2016-04-23 10:23 ` Dan Carpenter
2016-04-25 18:59 ` Tom Zanussi
2016-04-25 18:59   ` Tom Zanussi
2016-04-26 13:41   ` Steven Rostedt
2016-04-26 13:41     ` Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.