Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1386752

Re: [patch] tracing: checking for NULL instead of IS_ERR()

From Tom Zanussi <tom.zanussi@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [patch] tracing: checking for NULL instead of IS_ERR()
Date 2016-04-25 21:00 +0200
Message-ID <rrTTI-2ag-31@gated-at.bofh.it> (permalink)
References <rr2Z4-1v8-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[patch] tracing: checking for NULL instead of IS_ERR() Dan Carpenter <dan.carpenter@oracle.com> - 2016-04-23 12:30 +0200
  Re: [patch] tracing: checking for NULL instead of IS_ERR() Tom Zanussi <tom.zanussi@linux.intel.com> - 2016-04-25 21:00 +0200
    Re: [patch] tracing: checking for NULL instead of IS_ERR() Steven Rostedt <rostedt@goodmis.org> - 2016-04-26 15:50 +0200

csiph-web