From nobody Wed Dec 27 00:06:16 2023 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 4T0Bkc4Kbtz54bgw; Wed, 27 Dec 2023 00:06:16 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T0Bkc2qjJz4K5f; Wed, 27 Dec 2023 00:06:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703635576; 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=6+PmXaOc/7fCyN93iAI3xdWNc2w3Mn42jQsJrUhT73s=; b=XNdGQaKOhK/a3/SvZrLXVsN9S6bdLJxSB/R7SWFZFxcIMlXSNaV6G9BM6QgcDTeDTEDyW7 H5Da0P7nIhsUvMTL0+SZPZ4On09TP2rsNXWzXFsi8HhAgsK+Td7RXRDSIeIXRUaJ2tF1H3 xiwkypC/GJKLPrZCSJKmGaYIeMqS6sGvRtlIAMxVItBe27f5QIfGD48pUPzwcjhzSHooPn gCt/qyvKt67idj21nplOih3kzh3/bmOLhnssHdikp1jUsNs+kNlVn3xf4sysMD01ZeXnbh 33eEj8B4KGUOZ2S4sj1LZdIcA8/pxn433+EtoRhmnn+p66c9F4yeYqWtlE/HIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703635576; a=rsa-sha256; cv=none; b=IVdqt+FOSyCdKs4OIdL4hU3syPuQHeDMgRmuxRDToc4U5YqCMjHboF1kIZKUERf1sQeX2D 0LZvLBw57cAhmZ95/hShXBny0w5oH0FRF1WlIG3KAEwutMaIJfR8B6FzyUgE7dN7GGm9ll +m0IAGoK39as+U2OZIXWhT8FwqO3sEcOvTEA1USXvIVBFW2xIYWaEb+qH3DhVw8JDbXCyx HheYdiTJLWqwHEPz05UGaDTJK4dfRUabDsBUkImV7qbrnQ0NWhWeArTBoOmMjscVH3gIJ+ 7Rb2ne/umNoua/R4Wisp1fZ1KqqyvYLXWATytFS2guEjI4HwcMoWRdVvDd7fNg== 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=1703635576; 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=6+PmXaOc/7fCyN93iAI3xdWNc2w3Mn42jQsJrUhT73s=; b=Ilj+e3iRFgwFkhEADUp8H41/ZQr/wQlH7tBc/HEXMKFEBGk38wmoVdeCzvcLqn+OEPOAz4 Jtwjl7SE0gEP89lFJA4Ge1Y03xYDJ4QmM5b75byA5mC8194q9zjS63zDm23C5KqFSVlu9g CDtNTPv7n8CgRYECBIXWMevjML4CQvjj6OxX8RXB+shYusM6WILVd8TMQjx6HBCAOFZ2WJ FgGnIdlWEi+AXQiKLjfTeDgG7LOeVefUCYa7pb81Qtp2z6cA+6zp3r1VqvQQCC03BD/V9A d3Bnp1PqqFfUTVYM0CnNO5PO0aKVvlCvwgdDErxnkEbwhvQZCl+bGPvoFdlMgg== 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 4T0Bkc1dj0z22q; Wed, 27 Dec 2023 00:06:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BR06Gks018850; Wed, 27 Dec 2023 00:06:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BR06GFF018847; Wed, 27 Dec 2023 00:06:16 GMT (envelope-from git) Date: Wed, 27 Dec 2023 00:06:16 GMT Message-Id: <202312270006.3BR06GFF018847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: b4a9e6d81447 - main - hptmv: Handle errors from copyout() in hpt_set_info() 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4a9e6d81447c46c7bae56dc798097d9d3a4c495 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b4a9e6d81447c46c7bae56dc798097d9d3a4c495 commit b4a9e6d81447c46c7bae56dc798097d9d3a4c495 Author: Mark Johnston AuthorDate: 2023-12-27 00:00:01 +0000 Commit: Mark Johnston CommitDate: 2023-12-27 00:01:26 +0000 hptmv: Handle errors from copyout() in hpt_set_info() This is in preparation for annotating copyin() and related functions with __result_use_check. MFC after: 1 week --- sys/dev/hptmv/hptproc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/hptmv/hptproc.c b/sys/dev/hptmv/hptproc.c index 136b9c59a02a..8f9fffdc5af1 100644 --- a/sys/dev/hptmv/hptproc.c +++ b/sys/dev/hptmv/hptproc.c @@ -338,13 +338,13 @@ hpt_set_info(int length) if (err==0) { if (piop->nOutBufferSize) - copyout(ke_area + piop->nInBufferSize, (void*)(ULONG_PTR)piop->lpOutBuffer, piop->nOutBufferSize); + err = -copyout(ke_area + piop->nInBufferSize, (void*)(ULONG_PTR)piop->lpOutBuffer, piop->nOutBufferSize); - if (piop->lpBytesReturned) - copyout(&dwRet, (void*)(ULONG_PTR)piop->lpBytesReturned, sizeof(DWORD)); + if (err == 0 && piop->lpBytesReturned) + err = -copyout(&dwRet, (void*)(ULONG_PTR)piop->lpBytesReturned, sizeof(DWORD)); free(ke_area, M_DEVBUF); - return length; + return err == 0 ? length : err; } else KdPrintW(("Kernel_ioctl(): return %d\n", err));