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:   Fri, 29 Jul 2022 12:56:47 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     liqiong <liqiong@...china.com>
Cc:     Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
        yuzhe@...china.com, renyu@...china.com, jiaming@...china.com
Subject: Re: [PATCH] tracing: Do PTR_ERR() after IS_ERR()

On Thu, 28 Jul 2022 08:28:08 +0800
liqiong <liqiong@...china.com> wrote:

> It's all right, assign  PTR_ERR()  to 'ret'  anyway.
> But this assignment is valid only at the "IS_ERR()" path.
> Maybe it is better put "PTR_ERR()" at error path, keep the code clear.

No it does not. It adds unnecessary brackets.

It is common in the kernel to have:

	ret = ERROR;
	if (some_condition())
		goto out;

	ret = ERROR1;
	if (some_other_condition())
		goto out;

	ret = ERROR2;
	if (some_new_condition())
		goto out;

	ret = 0;
out:
	return ret;

And your change breaks this.

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ