From nobody Thu Jan 04 13:48:07 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 4T5SbD050vz56R0F; Thu, 4 Jan 2024 13:48:08 +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 4T5SbC4MFRz461v; Thu, 4 Jan 2024 13:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704376087; 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=u/zCt7MEz6Q0aqhx4BRsZoHRHEP6jkqKCIKkHLumYXc=; b=aKRlo8+0L3w+gHTSnNCrJSqcYy4RHdYU+SuaWn6oKeffY/eSDbvmQ+hLRWI4tCKRq9bC8U 3G9PopnWGSuPOl79YXol/QxLNKenah9PKDkr87Sk0OgP4RhAMXiCwMry5oSM7sRK/gAFNv 408eNkwn7747hBe8sY/S6lqlBz+8/FivOEqMhU0E90mtyBEFUmXsmtoJzCxPd4iKGHAUdy Fwg3RBV8tPpfOZNu9/b/pfZGLgiuk04Su5N1d4vGvtvB77y/FSlFkvqBT406KO3oSnEM3w +ngP0NZh5hjYEorBpCFemN0n+ScPLzBmDPucUO6qWcYtzSMLoJb6h/SgGO0cGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704376087; 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=u/zCt7MEz6Q0aqhx4BRsZoHRHEP6jkqKCIKkHLumYXc=; b=chl9Jxfkewu+gnzE8sIKZnkgxP754zrC4QdSVHQ51kXEw9cfmmPzD/JadPK1kE67vWQ9iF G1b635AofujgUjZ33y9VatfTahigfVmaW5TIqWZtqazjHKY0o8i5cZzFAfpLbUGDzfmN8Y 4iHyprU274JCrr/t4Zi0MkX5EjjtETsP0e/4gEeQK0HfnGbW3gMjQhaVKuiENFAhrHnDvW lW1FBE4P6bYsFDoEe27RQSga+lUvfKl8gdLPvcZrB5AXLacy9K6P97MWA0tLN1mVfirMDe O5+6QDHrowrnxdm75YlY9oV2BNoEfzt9EsVU3FJxNhJQJckpLB3Io6nkTO3bRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704376087; a=rsa-sha256; cv=none; b=BxEcQeGersbJsfBQgV7UfjiZ8IZuLwjnf360l4m7IqtP2Ivg51sOzvUxqjLRv64hkpNMMC IkTRB62IuGC2hc2n/3KLsVInQxE6vqgrWNFzxROfzqwjJuLQJT86Nlt2kjcbtFRGsy9elQ lWY66VNCEoLjIHidhtCSNiGSwIN7CWdkm6fOGdCSnD0j9H/zOr2n/cJbgr/MC4E8wTLgYr EB9KyVJVhBDsbwecq7a6GSWcH1GiNO90LGhl5JG3O8z6uq/7jZYaZ8Hpx0kboQCTQZagiC 6BneuTYVjRMKLfWWwdSEMGDOnmCK5288TPknvd/ObyodFNLU8szG+XlkAupEiw== 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 4T5SbC3T0JzGRt; Thu, 4 Jan 2024 13:48:07 +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 404Dm70E049934; Thu, 4 Jan 2024 13:48:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 404Dm7gK049931; Thu, 4 Jan 2024 13:48:07 GMT (envelope-from git) Date: Thu, 4 Jan 2024 13:48:07 GMT Message-Id: <202401041348.404Dm7gK049931@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: 9fcacefa3812 - stable/14 - sa: Check for errors from copyout() 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: 9fcacefa381276db6f19ab21992aff7237f8e6c1 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9fcacefa381276db6f19ab21992aff7237f8e6c1 commit 9fcacefa381276db6f19ab21992aff7237f8e6c1 Author: Mark Johnston AuthorDate: 2023-12-27 21:28:28 +0000 Commit: Mark Johnston CommitDate: 2024-01-04 13:42:26 +0000 sa: Check for errors from copyout() This is in preparation for annotating copyin() and related functions with __result_use_check. Reviewed by: ken MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43203 (cherry picked from commit 4d3c234d8eb32f903d630b371208a0a931d3d5fe) --- sys/cam/scsi/scsi_sa.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c index 78b22ba7eba1..07b917daa0c0 100644 --- a/sys/cam/scsi/scsi_sa.c +++ b/sys/cam/scsi/scsi_sa.c @@ -1495,8 +1495,12 @@ saparamsetlist(struct cam_periph *periph, struct mtsetlist *list, bailout: if (need_copy != 0) { if (error != EFAULT) { + int error1; + cam_periph_unlock(periph); - copyout(params, list->params, list->param_len); + error1 = copyout(params, list->params, list->param_len); + if (error == 0) + error = error1; cam_periph_lock(periph); } free(params, M_SCSISA);