[for-next][PATCH 2/5] tracing: checking for NULL instead of IS_ERR()
From: Steven Rostedt
Date: Wed Apr 27 2016 - 12:33:00 EST
From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
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@xxxxxxxxxxxxxxx>
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
---
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