Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Sep 2024 05:08:18 GMT
From:      Zhenlei Huang <zlei@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 783ec23313de - stable/13 - bnxt(4): Stop checking for failures from malloc(M_WAITOK)
Message-ID:  <202409300508.48U58IZH024813@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=783ec23313de492b7fd6bdcf58c6af9aa3a10163

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

    bnxt(4): Stop checking for failures from malloc(M_WAITOK)
    
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D45852
    
    (cherry picked from commit dcd387aaa5d4409a7e99376e0254029fce1a48a8)
    (cherry picked from commit e763c326fc85c0d8b3e86d954339aa847f13a934)
---
 sys/dev/bnxt/bnxt_mgmt.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/sys/dev/bnxt/bnxt_mgmt.c b/sys/dev/bnxt/bnxt_mgmt.c
index d54d7a2a2fe1..6ec47e2c1191 100644
--- a/sys/dev/bnxt/bnxt_mgmt.c
+++ b/sys/dev/bnxt/bnxt_mgmt.c
@@ -141,19 +141,7 @@ bnxt_mgmt_process_hwrm(struct cdev *dev, u_long cmd, caddr_t data,
 	}
 
 	req = malloc(msg_temp.len_req, M_BNXT, M_WAITOK | M_ZERO);
-	if(!req) {
-		device_printf(softc->dev, "%s:%d Memory allocation failed",
-			      __FUNCTION__, __LINE__);
-		return -ENOMEM;
-	}
-	
 	resp = malloc(msg_temp.len_resp, M_BNXT, M_WAITOK | M_ZERO);
-	if(!resp) {
-		device_printf(softc->dev, "%s:%d Memory allocation failed",
-			      __FUNCTION__, __LINE__);
-		ret = -ENOMEM;
-		goto end;
-	}
 
 	if (copyin((void *)msg_temp.usr_req, req, msg_temp.len_req)) {
 		device_printf(softc->dev, "%s:%d Failed to copy data from user\n",
@@ -173,12 +161,6 @@ bnxt_mgmt_process_hwrm(struct cdev *dev, u_long cmd, caddr_t data,
 			     (num_ind * sizeof(struct dma_info));
 
 		msg2 = malloc(size, M_BNXT, M_WAITOK | M_ZERO);
-		if(!msg2) {
-			device_printf(softc->dev, "%s:%d Memory allocation failed",
-				      __FUNCTION__, __LINE__);
-			ret = -ENOMEM;
-			goto end;
-		}
 
 		if (copyin((void *)mgmt_req.req.hreq, msg2, size)) { 
 			device_printf(softc->dev, "%s:%d Failed to copy"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202409300508.48U58IZH024813>