From nobody Mon Sep 30 04:45:36 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 4XH7md0SMrz5XkMY; Mon, 30 Sep 2024 04:45:37 +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 4XH7mc3LJ7z4Ffb; Mon, 30 Sep 2024 04:45:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727671536; 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=l3pR/KU21c61vsx3FUQCt6s5GoJ4PIdesJOO5n9KMO4=; b=TMfcKGLEcGVgJV5QHGmG93zs+hETT9WeDavCuJfiEJyjn3QU5lJ1+8DRXj0Yr9Uh9zT8OK OepdwHvfWL+xeydB5a7QT6naQ5G2GJLn0UBxaoQeexbH6vRnfbJYIrJZo41zNpNp6Cr5hC wMX+/QOdzcJhl71gKQWj7hqhuUIaW9v0u7QhBb3UrO5AnP90KGefCOEmVB+FH76ZyTZFir HG+homGnRmBueT7bu7YVW4EdCN5NxQribyKPI/sqsB5vFat4BYEClj1Iy9ESQJqb/4KmkR HCAlsKgNN8Fjc0TSIejOF2HdAct05qAi+AvNV2uArPPxd5O3KLRaxn7uXTY5Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727671536; 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=l3pR/KU21c61vsx3FUQCt6s5GoJ4PIdesJOO5n9KMO4=; b=uZthpnNm6CfaOaeFpuctobi5HyYG77sNMz4BmW12uqL21mCI12qdWZpQm8X7p1bxgEV7kq B20qjHmzX7tcrd+QqRBTFkfT/70o/tI86DE0+uv29IG99aFieGdd0Hzwrv40zm8fO+TaXs MggIPXJbjwn+BlADmcu/n+VWOnVhUhsFToLuOmepnV4iKIGWp5wncVWI9iFi1evWMJsU/G Qo5c5vbnJWfZSQv85eqFIQHcxbVuZvaIl//8Qvw0ncF6yFCbRQhI0WA9j1tf+l2/ybJN4x hvEp65TpCMnbWxQvcL5uVfalprYwsh7FriyFQHMkIg/KNh3RetsHC0LBOOxMzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727671536; a=rsa-sha256; cv=none; b=MNS187Q30PLKLqctmyPDAEvuRBsduk4XZGh3OKqXvQ4hOkvFZwD2J9hJBac+xI3j6v61Up +HCrc0xdCISrd1LskgjfvkjnD/UmYpuFEuNdyFsXkp8yaCBQGSfbPBLNe6rV7D/mNkqFNX 5Zhskya8GyAOcvu+A0NC+9i4H2b+2U+0tKOns4tY6vytmOshhJnz0ktP0dM/sSfNrr6aYX 6zPJW6RuyLDC7PT2Vh0Hgnr3+RLKDjMMVNgv0GoN77soeBQ7HxiMCky/MUYpYCw0BoNb8v 9+h47kfktuMwg/dMLEfNFbFimfAfKGHscP1ChSMWnhx0wH4hSYFCMs42dghNLA== 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 4XH7mc2tZ5zdwN; Mon, 30 Sep 2024 04:45:36 +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 48U4jamm087435; Mon, 30 Sep 2024 04:45:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48U4ja99087432; Mon, 30 Sep 2024 04:45:36 GMT (envelope-from git) Date: Mon, 30 Sep 2024 04:45:36 GMT Message-Id: <202409300445.48U4ja99087432@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 0341c77f203e - stable/14 - hpt27xx(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/stable/14 X-Git-Reftype: branch X-Git-Commit: 0341c77f203e5200470657a428f8ce63f2dc9988 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=0341c77f203e5200470657a428f8ce63f2dc9988 commit 0341c77f203e5200470657a428f8ce63f2dc9988 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:28 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-30 04:44:22 +0000 hpt27xx(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 (cherry picked from commit 28e413a699838df6fa5b0504c9ceb92a515037d9) --- 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 32d3e465c569..a40cb69e47f0 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);