git: 20805d47938b - stable/13 - iser(4): Stop checking for failures from malloc(M_WAITOK)

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Mon, 30 Sep 2024 05:08:30 UTC
The branch stable/13 has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=20805d47938b9e3ae936b50d257fc2f40ad1081f

commit 20805d47938b9e3ae936b50d257fc2f40ad1081f
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2024-09-03 10:25:30 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2024-09-30 05:05:37 +0000

    iser(4): Stop checking for failures from malloc(M_WAITOK)
    
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D45852
    
    (cherry picked from commit 40a6bbc4284111790d9240f8a24ef11a9a9ecb07)
    (cherry picked from commit ec68da0a7e6e8041672f515a6d09fe43ce8838a1)
---
 sys/dev/iser/iser_verbs.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/sys/dev/iser/iser_verbs.c b/sys/dev/iser/iser_verbs.c
index f5f057b961ef..f0c7e524ccf0 100644
--- a/sys/dev/iser/iser_verbs.c
+++ b/sys/dev/iser/iser_verbs.c
@@ -212,8 +212,6 @@ iser_create_device_ib_res(struct iser_device *device)
 
 	device->comps = malloc(device->comps_used * sizeof(*device->comps),
 		M_ISER_VERBS, M_WAITOK | M_ZERO);
-	if (!device->comps)
-		goto comps_err;
 
 	max_cqe = min(ISER_MAX_CQ_LEN, ib_dev->attrs.max_cqe);
 
@@ -280,7 +278,6 @@ cq_err:
 	ib_dealloc_pd(device->pd);
 pd_err:
 	free(device->comps, M_ISER_VERBS);
-comps_err:
 	ISER_ERR("failed to allocate an IB resource");
 	return (1);
 }
@@ -343,11 +340,6 @@ iser_create_fastreg_desc(struct ib_device *ib_device, struct ib_pd *pd)
 	int ret;
 
 	desc = malloc(sizeof(*desc), M_ISER_VERBS, M_WAITOK | M_ZERO);
-	if (!desc) {
-		ISER_ERR("Failed to allocate a new fastreg descriptor");
-		return (NULL);
-	}
-
 	ret = iser_alloc_reg_res(ib_device, pd, &desc->rsc);
 	if (ret) {
 		ISER_ERR("failed to allocate reg_resources");
@@ -509,9 +501,6 @@ iser_device_find_by_ib_device(struct rdma_cm_id *cma_id)
 			goto inc_refcnt;
 
 	device = malloc(sizeof *device, M_ISER_VERBS, M_WAITOK | M_ZERO);
-	if (device == NULL)
-		goto out;
-
 	/* assign this device to the device */
 	device->ib_device = cma_id->device;
 	/* init the device and link it into ig device list */