targ: Handle errors from suword()

In targstart() we are already handling an error and have no go way to
signal the failure to upper layers, so ignore the return value of
suword() there.

This is in preparation for annotating copyin() and related functions
with __result_use_check.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D43202
This commit is contained in:
Mark Johnston
2024-01-04 08:34:31 -05:00
parent a0993376ec
commit 904cd456f0
+6 -3
View File
@@ -634,8 +634,8 @@ targstart(struct cam_periph *periph, union ccb *start_ccb)
xpt_print(periph->path,
"targsendccb failed, err %d\n", error);
xpt_release_ccb(start_ccb);
suword(&descr->user_ccb->ccb_h.status,
CAM_REQ_CMP_ERR);
(void)suword(&descr->user_ccb->ccb_h.status,
CAM_REQ_CMP_ERR);
TAILQ_INSERT_TAIL(&softc->abort_queue, descr, tqe);
notify_user(softc);
}
@@ -867,7 +867,10 @@ targread(struct cdev *dev, struct uio *uio, int ioflag)
CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH,
("targread aborted descr %p (%p)\n",
user_descr, user_ccb));
suword(&user_ccb->ccb_h.status, CAM_REQ_ABORTED);
if (suword(&user_ccb->ccb_h.status, CAM_REQ_ABORTED) != 0) {
error = EFAULT;
goto read_fail;
}
cam_periph_unlock(softc->periph);
error = uiomove((caddr_t)&user_ccb, sizeof(user_ccb), uio);
cam_periph_lock(softc->periph);