Skip to content

Commit

Permalink
tracing: checking for NULL instead of IS_ERR()
Browse files Browse the repository at this point in the history
tracing_map_elt_alloc() returns ERR_PTRs on error, never NULL.

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

Acked-by: Tom Zanussi <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
  • Loading branch information
Dan Carpenter authored and rostedt committed Apr 26, 2016
1 parent 2055062 commit 4812952
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/tracing_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4812952

Please sign in to comment.