From nobody Thu Jan 04 13:48:02 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 4T5Sb71vYDz56R04; Thu, 4 Jan 2024 13:48:03 +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 4T5Sb70sBsz45cM; Thu, 4 Jan 2024 13:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704376083; 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=ysWutvo9WBVrqSmDYNA3hXij8/Kw16jM667vXkNd7jg=; b=sU7YKMOWYCNzTjPcH2xMNAlfTZhftY72pPiO7+86xkB73Vxj6ApFOkS6ULw3bkJjRhfc41 2KofI2yRtOh2CKc4DpulNlbddupnT0TEM5uB8j7zT/Q1oarfPIMZHjr77scklaqBeIyGzh cakkVgP1NsNVXfGnhSd/Bs/LHM/f6ZOQkBVzucQGXM17A1HwXnUjXk3+xS8mxogYw+ObZD t/HVZPrNnQAl17RUB+P9WduH3nFbpNRX6t0f8RL8Qy6oDlmwtCJDaqTo+xjB3XjlEX9ZWq U4KRpJvupmh0NbCNjPGmdsYEWTjjIbh2mk+L6lI6HJBSaURtRQPK+IcMtQGEeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704376083; 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=ysWutvo9WBVrqSmDYNA3hXij8/Kw16jM667vXkNd7jg=; b=tm2+J3eUEXMBKn0twnqg0NeBzTZ5yeGSmxc3452749rY7+/I8b0phdE4a7KbETgM/LoLvx 5wROf9PT5mmCyG5dEdwut7hh2GkBqCIvasWDaA6nePq5oz8dJIE4t/uUD3ZwJ/xICemEmF kOtC1dfv3irTMsGwU7ZkmfVoeLwBzR3wrHqliWVnePG/+12/CaB9Y4imm+OKHpHPP0QHKO mIUMSdER2vYfobzJhOXnaRTzAqnnbIDl/4YSVhDWfRE5ff9eX5yMISG5oYlexeGDgMt34b uDXAlTDXtzUXAVef1cxuI4TwAGM0+o3GqFxtWG4653icesepabuJbIGltfwslg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704376083; a=rsa-sha256; cv=none; b=sj/cqCEIlxN5iNJ9fy0ETDgiVc9dYRbL7X+Y1KtASxd4y+Dd3qTmB+WuFIbZrOMjXM/HtH q39NIVe/NSfcQ+Ri7zsZ2kgItvb6r5nbkG1E5zAw0jRSoEIzQ3X4RGpDOAw/W5GXRpPpmb BAqe2ksUPoLHJikPpJy44hAyRLfSibdAVBiW9cYyXvXW0OAbxpQIuDjsxvdfQ0l0pW70sR 1DXwv33fpDVIcEE9t/o0tzKyr3y43HoIA0JzYXFUkIaRp8UnvslLcI9Wwsm3FwPiFZt4bm 59BBa+IZUZG6BjZ5pYJJg4aRBXLTJo5vth3Zt50MU9OWKul2Zf+FM4xBbzoBvQ== 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 4T5Sb672fWzGPY; Thu, 4 Jan 2024 13:48:02 +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 404Dm2Qo049736; Thu, 4 Jan 2024 13:48:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 404Dm2iV049733; Thu, 4 Jan 2024 13:48:02 GMT (envelope-from git) Date: Thu, 4 Jan 2024 13:48:02 GMT Message-Id: <202401041348.404Dm2iV049733@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1e7389419122 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 1e73894191229aa896b99348a31cfa93260c08de Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1e73894191229aa896b99348a31cfa93260c08de commit 1e73894191229aa896b99348a31cfa93260c08de Author: Mark Johnston AuthorDate: 2023-12-27 00:00:01 +0000 Commit: Mark Johnston CommitDate: 2024-01-04 13:42:13 +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 (cherry picked from commit b4a9e6d81447c46c7bae56dc798097d9d3a4c495) --- 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));