lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141005190223.GB1934@krava.redhat.com>
Date:	Sun, 5 Oct 2014 21:02:23 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	kan.liang@...el.com
Cc:	linux-kernel@...r.kernel.org, ak@...ux.intel.com, acme@...nel.org
Subject: Re: [PATCH V7 2/4] perf tools: parse the pmu event prefix and suffix

On Fri, Oct 03, 2014 at 12:09:06PM -0400, kan.liang@...el.com wrote:
> From: Kan Liang <kan.liang@...el.com>

SNIP

> +/*
> + * Read the pmu events list from sysfs
> + * Save it into perf_pmu_events_list
> + */
> +static void perf_pmu__parse_init(void)
> +{
> +
> +	struct perf_pmu *pmu = NULL;
> +	struct perf_pmu_alias *alias;
> +	int len = 0;
> +
> +	pmu = perf_pmu__find("cpu");
> +	if ((pmu == NULL) || list_empty(&pmu->aliases)) {
> +		perf_pmu_events_list_num = -1;
> +		return;
> +	}
> +	list_for_each_entry(alias, &pmu->aliases, list) {
> +		if (strchr(alias->name, '-'))
> +			len++;
> +		len++;
> +	}
> +	perf_pmu_events_list = malloc(sizeof(struct perf_pmu_event_symbol) * len);
> +	perf_pmu_events_list_num = len;

missing allocation failure check

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ