summaryrefslogtreecommitdiffstats
path: root/sys/dev/ciss
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2003-07-12 22:37:03 +0000
committerps <ps@FreeBSD.org>2003-07-12 22:37:03 +0000
commitd62f9caa290ab53c0c790392fb7353144dddceff (patch)
tree73485331839fed551f73ad8b6a0ae1c972ddf768 /sys/dev/ciss
parent3da6cb86b116bf0bd5650330ce345d500344fdbb (diff)
downloadFreeBSD-src-d62f9caa290ab53c0c790392fb7353144dddceff.zip
FreeBSD-src-d62f9caa290ab53c0c790392fb7353144dddceff.tar.gz
Check the status of the user command and return the proper error
to the user.
Diffstat (limited to 'sys/dev/ciss')
-rw-r--r--sys/dev/ciss/ciss.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c
index ec8b622..c20ee6b 100644
--- a/sys/dev/ciss/ciss.c
+++ b/sys/dev/ciss/ciss.c
@@ -1922,7 +1922,7 @@ ciss_user_command(struct ciss_softc *sc, IOCTL_Command_struct *ioc)
struct ciss_request *cr;
struct ciss_command *cc;
struct ciss_error_info *ce;
- int error;
+ int error = 0;
debug_called(1);
@@ -1967,9 +1967,17 @@ ciss_user_command(struct ciss_softc *sc, IOCTL_Command_struct *ioc)
}
/*
- * Copy the results back to the user.
+ * Check to see if the command succeeded.
*/
ce = (struct ciss_error_info *)&(cc->sg[0]);
+ if (ciss_report_request(cr, NULL, NULL) == 0)
+ bzero(ce, sizeof(*ce));
+ else
+ error = EIO;
+
+ /*
+ * Copy the results back to the user.
+ */
bcopy(ce, &ioc->error_info, sizeof(*ce));
if ((ioc->buf_size > 0) &&
(error = copyout(cr->cr_data, ioc->buf, ioc->buf_size))) {
OpenPOWER on IntegriCloud