Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752698AbcDWKYT (ORCPT ); Sat, 23 Apr 2016 06:24:19 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:32213 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752371AbcDWKYN (ORCPT ); Sat, 23 Apr 2016 06:24:13 -0400 Date: Sat, 23 Apr 2016 13:23:47 +0300 From: Dan Carpenter To: Steven Rostedt , Tom Zanussi Cc: Ingo Molnar , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] tracing: checking for NULL instead of IS_ERR() Message-ID: <20160423102347.GA11136@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 604 Lines: 18 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)