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-next>] [day] [month] [year] [list]
Message-Id: <20211020084948.1038420-1-deng.changcheng@zte.com.cn>
Date:   Wed, 20 Oct 2021 08:49:48 +0000
From:   cgel.zte@...il.com
To:     axboe@...nel.dk
Cc:     asml.silence@...il.com, io-uring@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Changcheng Deng <deng.changcheng@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: [PATCH] io_uring: Use ERR_CAST() instead of ERR_PTR(PTR_ERR())

From: Changcheng Deng <deng.changcheng@....com.cn>

Use ERR_CAST() instead of ERR_PTR(PTR_ERR()).
This makes it more readable and also fix this warning detected by
err_cast.cocci:
./fs/io_uring.c: WARNING: 3208: 11-18: ERR_CAST can be used with buf

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@....com.cn>
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 695388aff926..e2d36607bf94 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -3205,7 +3205,7 @@ static struct iovec *__io_import_iovec(int rw, struct io_kiocb *req,
 		if (req->flags & REQ_F_BUFFER_SELECT) {
 			buf = io_rw_buffer_select(req, &sqe_len, issue_flags);
 			if (IS_ERR(buf))
-				return ERR_PTR(PTR_ERR(buf));
+				return ERR_CAST(buf);
 			req->rw.len = sqe_len;
 		}
 
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ