From nobody Tue Sep 03 10:27:15 2024 X-Original-To: dev-commits-src-main@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 4WyhdH5Zd5z5Mkh6; Tue, 03 Sep 2024 10:27:15 +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 4WyhdH3FX6z4sg5; Tue, 3 Sep 2024 10:27:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359235; 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=CTtaKgVhwStt4k2yZsFWZ2Mfy7IxpzC0sf9+Opz9JKU=; b=r6hx8TgelJ/zEtIrXQTHGix1pzqa6bbN0xeBv+cG0g5KuCAdLgm34VsounSkvzYY+0YBW0 BZ1/Tt4AM/WWl0W2gnZRZxE3y1rUXn2639pgMuwckxbzwv2gP0zJIbLBk4fNejtMbNl5HK MAIw16fHld2nIi8kiJnQt0RfIfG6IEUlVYFz24a2Gc+v1R9Km7Pb6sSuNl9jh4oNb3AkbU e2KmMFvMFJNSjPgfAsw657WG9NXNzfzbFmJp24+0Hc9zCLM5mRZfxyFTtLs02y0e3XnPy8 mK90THg0zLgRxv4nGLg3xNjIOvHlhxFEWw0/5Xn75qhKonApdB9EEUUUvGGntw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359235; a=rsa-sha256; cv=none; b=u6jICHZFAmBGXbGrSEc/xSp0QoMXPazxadaAF0sCrwbKWq7PWzmB5mvc1AojwXRIOJc1hq EYt9yjaGI8d+Cbm0ZaUaj/s5n7WImaSJhH98Db4SdWEuy/LslS7IeOXQxkgdzT/g8tPAUs 8v++9xUfeB5gidNLy7Mx8v9fNeeArH7uXFxvuFLDn5tAd80KzAdkpmLnygiuoRoJEJnEKu qAw70qmO+iHhDY6azE4Mv2LKFskUo6ko/LTD7vTMCVRxHUMkug6IL6NhyLalCWPQfssnNs 4bWvqCTORQGsvmB7vNwAo0u2elVcwijDNGfTh1sYSsDTk5bpa9jijFKZmmZKJA== 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=1725359235; 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=CTtaKgVhwStt4k2yZsFWZ2Mfy7IxpzC0sf9+Opz9JKU=; b=oABoibiMtMy/821BAzY3k/Xc+2IjsKNHvYqaWPjvvvP3BPpkLsw8dQuUuLUnL3oFs0pJy7 Ku+pmDzeYFRaKPDoAjaGnabcT9O9H3hpaEddAoiC90mnmUT8xP3/BCx+rtAVwckm7pozPS Z6gvVogIEwYfle3j/HzAfMQBUhsEuxxhA0PVCb7SvTXc67AuWJGZR9ZYuknxj1GNHWaeDs R0BvRS+r0Fdf/EQjvcn/hxpx14nCfUMiNjtJQULsB7fBCwXwUiD2ij8VKcg7ZfXewFwW1o bQBxvA904q6yUVtisq6o5bdogn4KFYbDHYYJ9esI9ZhcrzLZAEKkvxFJth3MTg== 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 4WyhdH2fSYzcnH; Tue, 3 Sep 2024 10:27:15 +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 483ARFpo010136; Tue, 3 Sep 2024 10:27:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARFJM010133; Tue, 3 Sep 2024 10:27:15 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:15 GMT Message-Id: <202409031027.483ARFJM010133@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: 28e413a69983 - main - hpt27xx(4): Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 28e413a699838df6fa5b0504c9ceb92a515037d9 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=28e413a699838df6fa5b0504c9ceb92a515037d9 commit 28e413a699838df6fa5b0504c9ceb92a515037d9 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:28 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:28 +0000 hpt27xx(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/hpt27xx/hpt27xx_osm_bsd.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/sys/dev/hpt27xx/hpt27xx_osm_bsd.c b/sys/dev/hpt27xx/hpt27xx_osm_bsd.c index 225c91b44f21..e086a1554940 100644 --- a/sys/dev/hpt27xx/hpt27xx_osm_bsd.c +++ b/sys/dev/hpt27xx/hpt27xx_osm_bsd.c @@ -94,9 +94,6 @@ static int hpt_attach(device_t dev) size = him->get_adapter_size(&pci_id); hba->ldm_adapter.him_handle = malloc(size, M_DEVBUF, M_WAITOK); - if (!hba->ldm_adapter.him_handle) - return ENXIO; - hba->pcidev = dev; hba->pciaddr.tree = 0; hba->pciaddr.bus = pci_get_bus(dev); @@ -114,10 +111,6 @@ static int hpt_attach(device_t dev) if (!ldm_register_adapter(&hba->ldm_adapter)) { size = ldm_get_vbus_size(); vbus_ext = malloc(sizeof(VBUS_EXT) + size, M_DEVBUF, M_WAITOK); - if (!vbus_ext) { - free(hba->ldm_adapter.him_handle, M_DEVBUF); - return ENXIO; - } memset(vbus_ext, 0, sizeof(VBUS_EXT)); vbus_ext->ext_type = EXT_TYPE_VBUS; ldm_create_vbus((PVBUS)vbus_ext->vbus, vbus_ext); @@ -168,7 +161,6 @@ static int hpt_alloc_mem(PVBUS_EXT vbus_ext) f->tag, f->count, f->size, f->count*f->size)); for (i=0; icount; i++) { p = (void **)malloc(f->size, M_DEVBUF, M_WAITOK); - if (!p) return (ENXIO); *p = f->head; f->head = p; } @@ -1109,10 +1101,6 @@ static void hpt_final_init(void *dummy) for (i=0; ivbus_ext = vbus_ext; ext->next = vbus_ext->cmdext_list; vbus_ext->cmdext_list = ext; @@ -1327,18 +1315,13 @@ 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);