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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160302093859.0565709d@gandalf.local.home>
Date:	Wed, 2 Mar 2016 09:38:59 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Tom Zanussi <tom.zanussi@...ux.intel.com>
Cc:	masami.hiramatsu.pt@...achi.com, namhyung@...nel.org,
	josh@...htriplett.org, andi@...stfloor.org,
	mathieu.desnoyers@...icios.com, peterz@...radead.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v15 03/23] tracing: Add hist trigger support for
 multiple values ('vals=' param)

On Fri, 26 Feb 2016 10:01:06 -0600
Tom Zanussi <tom.zanussi@...ux.intel.com> wrote:

> +static int create_val_field(struct hist_trigger_data *hist_data,
> +			    unsigned int val_idx,
> +			    struct trace_event_file *file,
> +			    char *field_str)
> +{
> +	struct ftrace_event_field *field = NULL;
> +	unsigned long flags = 0;
> +	int ret = 0;
> +
> +	if (WARN_ON(val_idx >= TRACING_MAP_VALS_MAX))
> +		return -EINVAL;
> +	field = trace_find_event_field(file->event_call, field_str);
> +	if (!field) {
> +		ret = -EINVAL;
> +		goto out;
> +	}
> +
> +	hist_data->fields[val_idx] = create_hist_field(field, flags);
> +	if (!hist_data->fields[val_idx]) {
> +		ret = -ENOMEM;
> +		goto out;
> +	}
> +
> +	if (WARN_ON(++hist_data->n_vals > TRACING_MAP_VALS_MAX))
> +		ret = -EINVAL;

Again, move the increment out of the WARN_ON().

> + out:
> +	return ret;
> +}
> +

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ