From nobody Mon Sep 30 05:08: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 4XH8Gy56nwz5Xlfn; Mon, 30 Sep 2024 05:08:26 +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 4XH8Gy2RScz4X8W; Mon, 30 Sep 2024 05:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727672906; 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=m9Blf9L4ustoAbC5LUpbLeU6zf8IreOPvaEmuvdiV2Q=; b=nPWnPcsVjUIxWy+XQJRKySf5xFZhWE/gRh5gFfcM4NzGp8smXUOSIjNI0W4kNkefHaWSGH CzOD1dgECj6BgcSR6mn79FAGKOX4/kXmlH2i7/vbYWYWmFXvaZUnfJ4KRvxfrmOiSPpwn3 N+PznT5dSxWuidXbOf4b+IkfsviBPddVoJxxu5mMnhgxCIDGbrtzuLRkz2EF50xpHrj9N2 C3f9Gxqh4neHwwn4HuX0pVSj1tKWSt94EOEoYm3Qyaresja3xbdFFyUwsxEmhUlL1ZcRBN 2oXquCUe51hmJOwnCXRfcOp0FZxj00S3Dt9jtcIvnVS/g04LFp5QxdwaV+G0NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727672906; 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=m9Blf9L4ustoAbC5LUpbLeU6zf8IreOPvaEmuvdiV2Q=; b=Qc5/wAN8MdwXASFmelQpjDqXg5JaM9wRzvW/qa1qnfO1mH9IvuDsmmX9YfRhA5wT8I4beM /N6qpAC/CMHloT8+EagIVHt+WNhwqPaG3uh/yaxi52vEPWLlpY+Bt+yH6Rf+0G+wim28Ng UuLwnnUpfLV5h6LSWFjHz3c5UWKMk4+YCNak81SJCokj43sZNJ40OYDUJw8ckAmLpy2pB4 uh7N6i5LRniZP6AsvLvQh/ZWImC9dWUg3p330jlzSII35qr2FGqbBqZp6R9Cub07RpQxiS ihDm9GXzmy6/qjwBs/Ga5kLnXEhdeLEt06+9OiOoQg/ZD4LA59zB80/0R58hsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727672906; a=rsa-sha256; cv=none; b=iw5nQ0l+Y5PnT4+rz8yYuoINSmE7hbLewaZiF7L1z/gnu3sg5BNrOmb0A3VoFta4dwRhyV HrVRivRq3x1q4CCesa0RLbwD6zys0tsCw3/K2Qf+gsF/sSYacQQk5uQXl5MmtE+7N13t6M bBcGi2P/9FfpUyjHLVopicR70TTz8IjH4b6aRUrBQ0MVa7e1kQzWKQrE+jcpxYAu5uRrhT vvrT29mId4ISVJkuMV9CCi4okgdbWwCFy3fjZSNMv8Gc281hu+1EZoei3vcdZs+5Gk6Pmf EQ5q1QKmwlK06nwL+Uv7Ivi9U4SCKoplq7mXnrSxwAQOS2cmdJGpLCoEAWPOsQ== 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 4XH8Gy23T5zfx8; Mon, 30 Sep 2024 05:08: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 48U58QBs025162; Mon, 30 Sep 2024 05:08:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48U58Qom025159; Mon, 30 Sep 2024 05:08:26 GMT (envelope-from git) Date: Mon, 30 Sep 2024 05:08:26 GMT Message-Id: <202409300508.48U58Qom025159@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: 3df0c68bdb28 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 3df0c68bdb28647f60b2b1cd34fb8cea390315ca Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3df0c68bdb28647f60b2b1cd34fb8cea390315ca commit 3df0c68bdb28647f60b2b1cd34fb8cea390315ca Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:28 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-30 05:05:36 +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) (cherry picked from commit 0341c77f203e5200470657a428f8ce63f2dc9988) --- 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 2c760d2e9009..dfa4d7c3baee 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; @@ -1328,18 +1316,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);