Re: [PATCH 16/16] perf, persistent: Allow multiple users for an event

From: Robert Richter
Date: Fri Jun 07 2013 - 09:47:34 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/