tracing: checking for NULL instead of IS_ERR()
Subsystems (2)
PATCH 1/1 tracing: checking for NULL instead of IS_ERR()
tracing_map_elt_alloc() returns ERR_PTRs on error, never NULL.
Fixes 08d43a5fa063 ('tracing: Add lock-free tracing_map')
Signed-off-by Dan Carpenter <[email protected]>
kernel/trace/tracing_map.c +1 -1
@@ -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)
Hi Dan,
Quoted 11 lines · Dan Carpenter
tracing_map_elt_alloc()returnsERR_PTRson error, never NULL.Fixes 08d43a5fa063 ('tracing: Add lock-free tracing_map')Signed-off-by Dan Carpenter <[email protected]>kernel/trace/tracing_map.c +0
-0
kernel/trace/tracing_map.c static struct tracing_map_elt *copy_elt(struct tracing_map_elt *elt) · line 820
Quoted 8 lines
kernel/trace/tracing_map.c +1
-1@@ -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)
Thanks for fixing this. I found another one along the same lines which I'll send a patch for shortly.
Acked-by Tom Zanussi <[email protected]>
Quoted 11 lines · On Mon, 25 Apr 2016 13:59:32 -0500 Tom Zanussi <[email protected]>…
Hi Dan,
Quoted 5 lines · Dan Carpenter
tracing_map_elt_alloc()returnsERR_PTRson error, never NULL.Fixes 08d43a5fa063 ('tracing: Add lock-free tracing_map')Signed-off-by Dan Carpenter <[email protected]>Acked-by Tom Zanussi <[email protected]>
Applied.
Thanks Dan and Tom,
-- Steve