bnxt(4): Stop checking for failures from malloc(M_WAITOK)

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852
This commit is contained in:
Zhenlei Huang 2024-09-03 18:25:25 +08:00
parent ab0b996bdd
commit dcd387aaa5

View File

@ -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"