Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1385625 > unrolled thread
| Started by | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| First post | 2016-04-23 12:30 +0200 |
| Last post | 2016-04-26 15:50 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[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
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Date | 2016-04-23 12:30 +0200 |
| Subject | [patch] tracing: checking for NULL instead of IS_ERR() |
| Message-ID | <rr2Z4-1v8-23@gated-at.bofh.it> |
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)
[toc] | [next] | [standalone]
| From | Tom Zanussi <tom.zanussi@linux.intel.com> |
|---|---|
| Date | 2016-04-25 21:00 +0200 |
| Message-ID | <rrTTI-2ag-31@gated-at.bofh.it> |
| In reply to | #1385625 |
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>
[toc] | [prev] | [next] | [standalone]
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Date | 2016-04-26 15:50 +0200 |
| Message-ID | <rsbxh-eJ-29@gated-at.bofh.it> |
| In reply to | #1386752 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web