Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933121AbcDYS7m (ORCPT ); Mon, 25 Apr 2016 14:59:42 -0400 Received: from mga04.intel.com ([192.55.52.120]:37729 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751933AbcDYS7k (ORCPT ); Mon, 25 Apr 2016 14:59:40 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,533,1455004800"; d="scan'208";a="966210988" Message-ID: <571E6914.90708@linux.intel.com> Date: Mon, 25 Apr 2016 13:59:32 -0500 From: Tom Zanussi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Dan Carpenter , Steven Rostedt CC: Ingo Molnar , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [patch] tracing: checking for NULL instead of IS_ERR() References: <20160423102347.GA11136@mwanda> In-Reply-To: <20160423102347.GA11136@mwanda> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 852 Lines: 27 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 > > 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