From nobody Tue Sep 03 10:27:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdW161Xz5MkhS; Tue, 03 Sep 2024 10:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WyhdV4fDhz4tDX; Tue, 3 Sep 2024 10:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JkShlhYlyzGMrEEaIsBE7kMg7MromkueJvfeYOWQmk8=; b=XfJsZm9Mlx0CBvs0X5gMBw5rcmgMOqOc6KvRVWRZV6qgfIT4Rcvoh21B0hP92i7lMLjS+1 kQYNsB0B3NwhOzO8BOM3FrsLc9X6T7eeVgTYku4GrEQ8Njw7GP77/QCvNPvTxz1ebKZ7Hw JpHryhx3fJMGICA6MQ1bAp4c0UYGRDblqfXF/O6t+oREF8iCa/WvJ0I3QuP6eQ4JIziBrY cMx3wLQQ12LStutWGBVt+dSJCkvcTGqQQEfKEFqPpbVLl+AqdAnA9nGVfjoEOxo+3l4Zca dkl6noTfbfwF+TMFBAH5eEMDnqtkzcrol6ku8F5hXaJFlS0W7OPH0uvj+AN5Gw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359246; a=rsa-sha256; cv=none; b=o1PZozC3F5S78hOVJxasij7F7IctzHxeXDQmV7sVM9kkKLPf99LFDkZpv2blKKQTQZLHRO HgvQzBL1VQNDJ6r/PWxvWQJGn7HHwho6AN3fntbVovMCc1V5fBQiCN6qX/jx8xCbugL85l vggOdzPA+12S47OAqHr9hPQD1dXTKN0CHeuT27it5jiSK1utQUNIiiQ5utFiG10rjgZc5Q GT/uxwvkLgxQspKl5h07ayXmrhUz3YcxVnKxWpq2pQSuwfvt0UyTJdQDXirocOhf2y600W asRjFIWOp0z0+esiY6BBKm3Ztu3apnp74BbbO3AYEfAF8L4TLhpxRPtrNru0yA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JkShlhYlyzGMrEEaIsBE7kMg7MromkueJvfeYOWQmk8=; b=ULFM0bgq/jjTaW2/Pd+EHifn0VuD7stMD4Rakk42uqh8Y6bXh4H8/v2pN480YGYPansHpg azSN6+/XopAzqC5tukYgKiFTtcyPxhvj6ZY0fgM5bSmDa9lmZ+e6Crdw9b8ecy0pRDVaAf rXQiLk75c6CxwuqT3jC8eufDX6loo0U9GrUZsayVq2qYBq85sa35Gr2cntSjgcsKxOOQmP 85HQ+4kUucQS888cmvl0b6+kfSLczvg47Z7Pd/tEfHbwZsFMJMk+ydiqaHK8p/CytWGowG 6/LWRrAWtMwEbjoXSSOMroaRcUfhS2b+S4L+65PXLnKdGMpLYwnYOVL73zxnHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WyhdV4GL3zcxq; Tue, 3 Sep 2024 10:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 483ARQfe010656; Tue, 3 Sep 2024 10:27:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARQwi010653; Tue, 3 Sep 2024 10:27:26 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:26 GMT Message-Id: <202409031027.483ARQwi010653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 4fb8a80a78aa - main - pms(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4fb8a80a78aa65e0b30bd5a74373512c678841c9 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=4fb8a80a78aa65e0b30bd5a74373512c678841c9 commit 4fb8a80a78aa65e0b30bd5a74373512c678841c9 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:32 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:32 +0000 pms(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/pms/freebsd/driver/ini/src/agtiapi.c | 38 +++------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c index c8c9eb8c8dd8..cd1b80c3d712 100644 --- a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c +++ b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c @@ -318,13 +318,6 @@ int agtiapi_getdevlist( struct agtiapi_softc *pCard, sizeof(void *) ); AGTIAPI_PRINTK("agtiapi_getdevlist: portCount %d\n", pCard->portCount); devList = malloc(memNeeded1, TEMP2, M_WAITOK); - if (devList == NULL) - { - AGTIAPI_PRINTK("agtiapi_getdevlist: failed to allocate memory\n"); - ret_val = IOCTL_CALL_FAIL; - agIOCTLPayload->Status = IOCTL_ERR_STATUS_INTERNAL_ERROR; - return ret_val; - } osti_memset(devList, 0, memNeeded1); pPortalData = &pCard->pPortalData[0]; pDeviceHandleList = (bit8*)devList; @@ -970,13 +963,8 @@ static int agtiapi_attach( device_t devx ) } else { - pmsc->pPortalData = (ag_portal_data_t *) - malloc( sizeof(ag_portal_data_t) * pmsc->portCount, + pmsc->pPortalData = malloc( sizeof(ag_portal_data_t) * pmsc->portCount, M_PMC_MPRT, M_ZERO | M_WAITOK ); - if (pmsc->pPortalData == NULL) - { - AGTIAPI_PRINTK( "agtiapi_attach: Portal memory allocation ERROR\n" ); - } } pPortalData = pmsc->pPortalData; @@ -1227,32 +1215,14 @@ STATIC agBOOLEAN agtiapi_InitCardHW( struct agtiapi_softc *pmsc ) pmsc->flags |= AGTIAPI_SYS_INTR_ON; numVal = sizeof(ag_device_t) * pmsc->devDiscover; - pmsc->pDevList = - (ag_device_t *)malloc( numVal, M_PMC_MDVT, M_ZERO | M_WAITOK ); - if( !pmsc->pDevList ) { - AGTIAPI_PRINTK( "agtiapi_InitCardHW: kmalloc %d DevList ERROR\n", numVal ); - panic( "agtiapi_InitCardHW\n" ); - return AGTIAPI_FAIL; - } + pmsc->pDevList = malloc( numVal, M_PMC_MDVT, M_ZERO | M_WAITOK ); #ifdef LINUX_PERBI_SUPPORT numVal = sizeof(ag_slr_map_t) * pmsc->devDiscover; - pmsc->pSLRList = - (ag_slr_map_t *)malloc( numVal, M_PMC_MSLR, M_ZERO | M_WAITOK ); - if( !pmsc->pSLRList ) { - AGTIAPI_PRINTK( "agtiapi_InitCardHW: kmalloc %d SLRList ERROR\n", numVal ); - panic( "agtiapi_InitCardHW SLRL\n" ); - return AGTIAPI_FAIL; - } + pmsc->pSLRList = malloc( numVal, M_PMC_MSLR, M_ZERO | M_WAITOK ); numVal = sizeof(ag_tgt_map_t) * pmsc->devDiscover; - pmsc->pWWNList = - (ag_tgt_map_t *)malloc( numVal, M_PMC_MTGT, M_ZERO | M_WAITOK ); - if( !pmsc->pWWNList ) { - AGTIAPI_PRINTK( "agtiapi_InitCardHW: kmalloc %d WWNList ERROR\n", numVal ); - panic( "agtiapi_InitCardHW WWNL\n" ); - return AGTIAPI_FAIL; - } + pmsc->pWWNList = malloc( numVal, M_PMC_MTGT, M_ZERO | M_WAITOK ); // Get the WWN_to_target_ID mappings from the // holding area which contains the input of the