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] [day] [month] [year] [list]
Message-ID: <20250401211015750qxOfU9XZ8QgKizM1Lcyq2@zte.com.cn>
Date: Tue, 1 Apr 2025 21:10:15 +0800 (CST)
From: <shao.mingyin@....com.cn>
To: <jgg@...pe.ca>
Cc: <leon@...nel.org>, <li.haoran7@....com.cn>, <linux-rdma@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <viro@...iv.linux.org.uk>,
        <brauner@...nel.org>, <agoldberger@...dia.com>, <cmeiohas@...dia.com>,
        <msanalla@...dia.com>, <dan.carpenter@...aro.org>,
        <mrgolin@...zon.com>, <phaddad@...dia.com>, <ynachum@...zon.com>,
        <mgurtovoy@...dia.com>, <yang.yang29@....com.cn>,
        <xu.xin16@....com.cn>, <ye.xingchen@....com.cn>
Subject: [PATCH 3/3] RDMA/core: Convert to use ERR_CAST()

From: Li Haoran <li.haoran7@....com.cn>

As opposed to open-code, using the ERR_CAST macro clearly indicates that
this is a pointer to an error value and a type conversion was performed.

Signed-off-by: Li Haoran <li.haoran7@....com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@....com.cn>
---
 drivers/infiniband/core/verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index c5e78bbefbd0..75fde0fe9989 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -572,7 +572,7 @@ struct ib_ah *rdma_create_ah(struct ib_pd *pd, struct rdma_ah_attr *ah_attr,
 					   GFP_KERNEL : GFP_ATOMIC);
 	if (IS_ERR(slave)) {
 		rdma_unfill_sgid_attr(ah_attr, old_sgid_attr);
-		return (void *)slave;
+		return ERR_CAST(slave);
 	}
 	ah = _rdma_create_ah(pd, ah_attr, flags, NULL, slave);
 	rdma_lag_put_ah_roce_slave(slave);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ