]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
RDMA/core: Fix logic error in ib_get_gids_from_rdma_hdr()
authorJang Ingyu <ingyujang25@korea.ac.kr>
Fri, 19 Dec 2025 04:15:08 +0000 (13:15 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:09:58 +0000 (13:09 +0100)
[ Upstream commit 8aaa848eaddd9ef8680fc6aafbd3a0646da5df40 ]

Fix missing comparison operator for RDMA_NETWORK_ROCE_V1 in the
conditional statement. The constant was used directly instead of
being compared with net_type, causing the condition to always
evaluate to true.

Fixes: 1c15b4f2a42f ("RDMA/core: Modify enum ib_gid_type and enum rdma_network_type")
Signed-off-by: Jang Ingyu <ingyujang25@korea.ac.kr>
Link: https://patch.msgid.link/20251219041508.1725947-1-ingyujang25@korea.ac.kr
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/core/verbs.c

index bdc9564f0ff820be58312d5b0b4d03ceff658a5b..53552559917c6ca617ff1fe57b0d96c11d3dbcc5 100644 (file)
@@ -740,7 +740,7 @@ int ib_get_gids_from_rdma_hdr(const union rdma_network_hdr *hdr,
                                       (struct in6_addr *)dgid);
                return 0;
        } else if (net_type == RDMA_NETWORK_IPV6 ||
-                  net_type == RDMA_NETWORK_IB || RDMA_NETWORK_ROCE_V1) {
+                  net_type == RDMA_NETWORK_IB || net_type == RDMA_NETWORK_ROCE_V1) {
                *dgid = hdr->ibgrh.dgid;
                *sgid = hdr->ibgrh.sgid;
                return 0;