The branch main has been updated by zlei:

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

commit dcd387aaa5d4409a7e99376e0254029fce1a48a8
Author:     Zhenlei Huang <z...@freebsd.org>
AuthorDate: 2024-09-03 10:25:25 +0000
Commit:     Zhenlei Huang <z...@freebsd.org>
CommitDate: 2024-09-03 10:25:25 +0000

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

diff --git a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c
index 2f82580352cb..72704c3db452 100644
--- a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c
+++ b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c
@@ -205,19 +205,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",
@@ -237,12 +225,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"

Reply via email to