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]
Date:   Mon, 29 Apr 2019 15:53:55 +0100
From:   Robert Walker <robert.walker@....com>
To:     Leo Yan <leo.yan@...aro.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        Mike Leach <mike.leach@...aro.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/2] perf cs-etm: Don't check cs_etm_queue::prev_packet
 validity


On 28/04/2019 09:32, Leo Yan wrote:
> Since cs_etm_queue::prev_packet is allocated for all cases, it will
> never be NULL pointer; now validity checking prev_packet is pointless,
> remove all of them.
>
> Signed-off-by: Leo Yan <leo.yan@...aro.org>
> ---
>   tools/perf/util/cs-etm.c | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)

Tested-by: Robert Walker <robert.walker@....com>

Regards

Rob

> diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
> index 054b480aab04..de488b43f440 100644
> --- a/tools/perf/util/cs-etm.c
> +++ b/tools/perf/util/cs-etm.c
> @@ -979,7 +979,6 @@ static int cs_etm__sample(struct cs_etm_queue *etmq)
>   	 * PREV_PACKET is a branch.
>   	 */
>   	if (etm->synth_opts.last_branch &&
> -	    etmq->prev_packet &&
>   	    etmq->prev_packet->sample_type == CS_ETM_RANGE &&
>   	    etmq->prev_packet->last_instr_taken_branch)
>   		cs_etm__update_last_branch_rb(etmq);
> @@ -1012,7 +1011,7 @@ static int cs_etm__sample(struct cs_etm_queue *etmq)
>   		etmq->period_instructions = instrs_over;
>   	}
>   
> -	if (etm->sample_branches && etmq->prev_packet) {
> +	if (etm->sample_branches) {
>   		bool generate_sample = false;
>   
>   		/* Generate sample for tracing on packet */
> @@ -1069,9 +1068,6 @@ static int cs_etm__flush(struct cs_etm_queue *etmq)
>   	struct cs_etm_auxtrace *etm = etmq->etm;
>   	struct cs_etm_packet *tmp;
>   
> -	if (!etmq->prev_packet)
> -		return 0;
> -
>   	/* Handle start tracing packet */
>   	if (etmq->prev_packet->sample_type == CS_ETM_EMPTY)
>   		goto swap_packet;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ