mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
Check the status of the user command and return the proper error
to the user.
This commit is contained in:
parent
4bca277bd3
commit
3c63a8b4fc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=117482
@ -1922,7 +1922,7 @@ ciss_user_command(struct ciss_softc *sc, IOCTL_Command_struct *ioc)
|
|||||||
struct ciss_request *cr;
|
struct ciss_request *cr;
|
||||||
struct ciss_command *cc;
|
struct ciss_command *cc;
|
||||||
struct ciss_error_info *ce;
|
struct ciss_error_info *ce;
|
||||||
int error;
|
int error = 0;
|
||||||
|
|
||||||
debug_called(1);
|
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]);
|
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));
|
bcopy(ce, &ioc->error_info, sizeof(*ce));
|
||||||
if ((ioc->buf_size > 0) &&
|
if ((ioc->buf_size > 0) &&
|
||||||
(error = copyout(cr->cr_data, ioc->buf, ioc->buf_size))) {
|
(error = copyout(cr->cr_data, ioc->buf, ioc->buf_size))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user