From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425906AbcFHOVQ (ORCPT ); Wed, 8 Jun 2016 10:21:16 -0400 Received: from terminus.zytor.com ([198.137.202.10]:34130 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161885AbcFHOVO (ORCPT ); Wed, 8 Jun 2016 10:21:14 -0400 Date: Wed, 8 Jun 2016 07:20:33 -0700 From: tip-bot for Alexander Shishkin Message-ID: Cc: dan.carpenter@oracle.com, mingo@kernel.org, tglx@linutronix.de, acme@infradead.org, hpa@zytor.com, torvalds@linux-foundation.org, alexander.shishkin@linux.intel.com, peterz@infradead.org, linux-kernel@vger.kernel.org Reply-To: mingo@kernel.org, dan.carpenter@oracle.com, acme@infradead.org, tglx@linutronix.de, torvalds@linux-foundation.org, hpa@zytor.com, alexander.shishkin@linux.intel.com, peterz@infradead.org, linux-kernel@vger.kernel.org In-Reply-To: <1465303455-26032-1-git-send-email-alexander.shishkin@linux.intel.com> References: <1465303455-26032-1-git-send-email-alexander.shishkin@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf/core: Remove a redundant check Git-Commit-ID: 62a92c8f553e49270a0ee391b8733da71ab0aebc X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 62a92c8f553e49270a0ee391b8733da71ab0aebc Gitweb: http://git.kernel.org/tip/62a92c8f553e49270a0ee391b8733da71ab0aebc Author: Alexander Shishkin AuthorDate: Tue, 7 Jun 2016 15:44:15 +0300 Committer: Ingo Molnar CommitDate: Wed, 8 Jun 2016 14:30:01 +0200 perf/core: Remove a redundant check There is no way to end up in _free_event() with event::pmu being NULL. The latter is initialized in event allocation path and remains set forever. In case of allocation failure, the error path doesn't use _free_event(). Having the check, however, suggests that it is possible to have a event::pmu==NULL situation in _free_event() and confuses the robots. This patch gets rid of the check. Reported-by: Dan Carpenter Signed-off-by: Alexander Shishkin Signed-off-by: Peter Zijlstra (Intel) Cc: Arnaldo Carvalho de Melo Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: eranian@google.com Cc: vince@deater.net Link: http://lkml.kernel.org/r/1465303455-26032-1-git-send-email-alexander.shishkin@linux.intel.com Signed-off-by: Ingo Molnar --- kernel/events/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index 050a290..87e945d 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -3862,10 +3862,8 @@ static void _free_event(struct perf_event *event) if (event->ctx) put_ctx(event->ctx); - if (event->pmu) { - exclusive_event_destroy(event); - module_put(event->pmu->module); - } + exclusive_event_destroy(event); + module_put(event->pmu->module); call_rcu(&event->rcu_head, free_event_rcu); }