tracing: checking for NULL instead of IS_ERR()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 23 Apr 2016 10:23:47 +0000 (13:23 +0300)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 26 Apr 2016 13:40:20 +0000 (09:40 -0400)
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

index e0f172932eca645859b8ee2e81b84564f3c8bd9c..e7dfc5eec6698d0b9c13f08f51c14aa9d99b20dd 100644 (file)
@@ -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)