Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754831Ab3FGNr3 (ORCPT ); Fri, 7 Jun 2013 09:47:29 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:37222 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752540Ab3FGNr2 (ORCPT ); Fri, 7 Jun 2013 09:47:28 -0400 Date: Fri, 7 Jun 2013 15:47:16 +0200 From: Robert Richter To: Borislav Petkov Cc: Jiri Olsa , Ingo Molnar , Peter Zijlstra , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org Subject: Re: [PATCH 16/16] perf, persistent: Allow multiple users for an event Message-ID: <20130607134716.GG3886@rric.localhost> References: <1369990056-10310-1-git-send-email-rric@kernel.org> <1369990056-10310-17-git-send-email-rric@kernel.org> <20130603134925.GA13548@krava.brq.redhat.com> <20130604082042.GB23640@pd.tnic> <20130604091921.GC1103@krava.brq.redhat.com> <20130604093522.GD23640@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130604093522.GD23640@pd.tnic> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 736 Lines: 28 On 04.06.13 11:35:22, Borislav Petkov wrote: > On Tue, Jun 04, 2013 at 11:19:21AM +0200, Jiri Olsa wrote: > > 'cpu' did not pass ay check here.. > > Oh, I see. > > You mean something like > > if (cpu < NR_CPUS && cpu_online(cpu)) In perf_event_alloc() there is: if ((unsigned)cpu >= nr_cpu_ids) { if (!task || cpu != -1) return ERR_PTR(-EINVAL); } So this should be sufficient: if ((unsigned)cpu >= nr_cpu_ids) ... -Robert -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/