From nobody Tue Sep 03 10:27:16 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 4WyhdK0Lz5z5MkVL; Tue, 03 Sep 2024 10:27:17 +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 4WyhdJ40zrz4scb; Tue, 3 Sep 2024 10:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359236; 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=hGTGHlf/jGA5DKRujz4ZUNNAFGl+6eE3q5M/RLTBY90=; b=fdgzFnN+hCU4yG2fxl6H5tkttTp+PkQd/DU5Qd+HtaOuqRQ9v1Rg5kBFxaAIjbS2rWTfUY sCzH9BNIpkyYZX/Ge8EE6ylPorIeV+U6DrOIVhgNE5Xl2NqCaCZrrEtFzi4Vhgmg0rAyAD ZJVRHq3SDs0L58S7oKVH/5NHdlwMpmSUS2SFSK+WpevtfFZcPXdsxW8x9d83HZkSSU+28o xDgfN3qD5gsVXWCOXq75wx7wpVrYbN1dkpBXCHdzEmuwfK8TyjwStBBiNYJYD0XfWhQTZB bOnYNysOxKFAGdqOrMhj6DsQyue053C+LDE/usakXzIE54ZknVWxNJAcOr5RbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359236; a=rsa-sha256; cv=none; b=VtDQ5QYpmBdx8ZBP/yMVPOqzFcl5cYUsU5kvPcGkjNRcrQcS9Atlavz3I9xjjRhWKa7myq 8ZTAtNMb1/Us5x3IqvX3GMNSsHMCe36srVSE5y7I6+g0kB3beKsGOpHLYyYnS7pBhvF9S1 wrfKevP71us5YYYJyqcPm2rjZ68x2ZKHjcAFOn0ouP0mQ3TZOdHgDYZK4zm4LCuMAuDur0 mu/fZwjVmx+QoGZoV5ULKmnv+ASGxJhUMXpjkv+b5LCJqou/nKnHCi0HusFJIeEDN0Qqey VD3GCl+I+uXpbaH4Om5kuhVQHK7atodfT5RCT6x40WL9jUMdH8n6qVA02F2aaw== 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=1725359236; 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=hGTGHlf/jGA5DKRujz4ZUNNAFGl+6eE3q5M/RLTBY90=; b=pjj/lqI1grm8wYud/TmTaj8MBExYlExffJVzrvpuRb3k+1jLO68bUelmu9RTo2Wt5CPuJB hHMxRPE7qs4BaS4kawi09BW/n12+uMpN1fVg7C+DbhxTl6OGHKutzCcVy7xa1XLacHpTV/ ZEZHBGqhhVgLla9jOT6vxvpAFeSXtmzltWcdqoJ1bdLFqhCjtHwiqLdAaDFQA9oXNnBQGR JrspKgVua/Njto53/XWAGiOBt6UW9LPjMLT0yL0YT9CHbdFwRtKw8ANsmXhlp3V5h9dzsI 4ibJlGEE499isV/yTCcXqDnncbC5xOia2cYj+B+BmnRJJQETT3RCOPNLwmezEw== 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 4WyhdJ3ddLzcb6; Tue, 3 Sep 2024 10:27:16 +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 483ARGkg010184; Tue, 3 Sep 2024 10:27:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARGQ3010181; Tue, 3 Sep 2024 10:27:16 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:16 GMT Message-Id: <202409031027.483ARGQ3010181@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: a3ec5d3ee757 - main - hptnr(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: a3ec5d3ee7579a26790a86ca4c074512946ab964 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a3ec5d3ee7579a26790a86ca4c074512946ab964 commit a3ec5d3ee7579a26790a86ca4c074512946ab964 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:29 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:29 +0000 hptnr(4): Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/hptnr/hptnr_osm_bsd.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sys/dev/hptnr/hptnr_osm_bsd.c b/sys/dev/hptnr/hptnr_osm_bsd.c index a8ac77c5ad5a..7426873964fb 100644 --- a/sys/dev/hptnr/hptnr_osm_bsd.c +++ b/sys/dev/hptnr/hptnr_osm_bsd.c @@ -165,7 +165,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; } @@ -1389,10 +1388,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; @@ -1610,19 +1605,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) {