Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Sep 2024 05:08:28 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: e86d353a893f - stable/13 - hptrr(4): Stop checking for failures from malloc(M_WAITOK)
Message-ID:  <202409300508.48U58S9i025263@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=e86d353a893f5f57ba420fef5fd5a1486ab64ae9

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

    hptrr(4): Stop checking for failures from malloc(M_WAITOK)
    
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D45852
    
    (cherry picked from commit 92b0370ec65d5287a1deec84fd513e320a8da736)
    (cherry picked from commit e4de0a965faaff171e6061714478c8f4eaec8cb1)
---
 sys/dev/hptrr/hptrr_osm_bsd.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/sys/dev/hptrr/hptrr_osm_bsd.c b/sys/dev/hptrr/hptrr_osm_bsd.c
index fd102397716c..ca1e5714d33e 100644
--- a/sys/dev/hptrr/hptrr_osm_bsd.c
+++ b/sys/dev/hptrr/hptrr_osm_bsd.c
@@ -1032,10 +1032,6 @@ static void hpt_final_init(void *dummy)
 
 		for (i=0; i<os_max_queue_comm; i++) {
 			POS_CMDEXT ext = (POS_CMDEXT)malloc(sizeof(OS_CMDEXT), M_DEVBUF, M_WAITOK);
-			if (!ext) {
-				os_printk("Can't alloc cmdext(%d)", i);
-				return ;
-			}
 			ext->vbus_ext = vbus_ext;
 			ext->next = vbus_ext->cmdext_list;
 			vbus_ext->cmdext_list = ext;
@@ -1253,19 +1249,14 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, stru
 
 		if (ioctl_args.nInBufferSize) {
 			ioctl_args.lpInBuffer = malloc(ioctl_args.nInBufferSize, M_DEVBUF, M_WAITOK);
-			if (!ioctl_args.lpInBuffer)
-				goto invalid;
 			if (copyin((void*)piop->lpInBuffer,
 					ioctl_args.lpInBuffer, piop->nInBufferSize))
 				goto invalid;
 		}
 	
-		if (ioctl_args.nOutBufferSize) {
+		if (ioctl_args.nOutBufferSize)
 			ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK | M_ZERO);
-			if (!ioctl_args.lpOutBuffer)
-				goto invalid;
-		}
-		
+
 		hpt_do_ioctl(&ioctl_args);
 	
 		if (ioctl_args.result==HPT_IOCTL_RESULT_OK) {



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