* [patch] tracing: checking for NULL instead of IS_ERR()
@ 2016-04-23 10:23 Dan Carpenter
2016-04-25 18:59 ` Tom Zanussi
0 siblings, 1 reply; 3+ 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] 3+ messages in thread* Re: [patch] tracing: checking for NULL instead of IS_ERR()
2016-04-23 10:23 [patch] tracing: checking for NULL instead of IS_ERR() Dan Carpenter
@ 2016-04-25 18:59 ` Tom Zanussi
2016-04-26 13:41 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Tom Zanussi @ 2016-04-25 18:59 UTC (permalink / raw)
To: Dan Carpenter, Steven Rostedt; +Cc: Ingo Molnar, linux-kernel, kernel-janitors
Hi Dan,
On 04/23/2016 05:23 AM, Dan Carpenter wrote:
> 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)
>
Thanks for fixing this. I found another one along the same lines which
I'll send a patch for shortly.
Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch] tracing: checking for NULL instead of IS_ERR()
2016-04-25 18:59 ` Tom Zanussi
@ 2016-04-26 13:41 ` Steven Rostedt
0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2016-04-26 13:41 UTC (permalink / raw)
To: Tom Zanussi; +Cc: Dan Carpenter, Ingo Molnar, linux-kernel, kernel-janitors
On Mon, 25 Apr 2016 13:59:32 -0500
Tom Zanussi <tom.zanussi@linux.intel.com> wrote:
> Hi Dan,
>
> On 04/23/2016 05:23 AM, Dan Carpenter wrote:
> > 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>
> >
>
> Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Applied.
Thanks Dan and Tom,
-- Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-26 13:41 UTC | newest]
Thread overview: 3+ 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-25 18:59 ` Tom Zanussi
2016-04-26 13:41 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox