> +     while ((pmu = perf_pmu__scan(pmu)) != NULL)
> +             list_for_each_entry(alias, &pmu->aliases, list) {
> +                     if (!strcmp(pmu->name, "cpu")) {
> +                             struct kernel_pmu_event_symbol *p =
> +                                     kernel_pmu_events_list + len;
> +                             char *tmp = strchr(alias->name, '-');
> +
> +                             if (tmp != NULL) {
> +                                     strncpy(p->symbol, alias->name,
> +                                                     tmp - alias->name);

Please use strlcpy(). Otherwise p->symbol may not be zero terminated.

The rest of the patch looks good to me.

-Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to