mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
usbip: usbip_host_common: Use new error codes to return request status
Currently ST_OK and ST_NA are the only values used to communicate status of a request from a client. Use new error codes to clearly indicate what failed. For example, when client sends request to import a device that isn't export-able, send ST_DEV_BUSY to the client. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f6bcbf2e24
commit
c207a10d2f
@@ -234,14 +234,17 @@ int usbip_export_device(struct usbip_exported_device *edev, int sockfd)
|
|||||||
switch (edev->status) {
|
switch (edev->status) {
|
||||||
case SDEV_ST_ERROR:
|
case SDEV_ST_ERROR:
|
||||||
dbg("status SDEV_ST_ERROR");
|
dbg("status SDEV_ST_ERROR");
|
||||||
|
ret = ST_DEV_ERR;
|
||||||
break;
|
break;
|
||||||
case SDEV_ST_USED:
|
case SDEV_ST_USED:
|
||||||
dbg("status SDEV_ST_USED");
|
dbg("status SDEV_ST_USED");
|
||||||
|
ret = ST_DEV_BUSY;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dbg("status unknown: 0x%x", edev->status);
|
dbg("status unknown: 0x%x", edev->status);
|
||||||
|
ret = -1;
|
||||||
}
|
}
|
||||||
return -1;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* only the first interface is true */
|
/* only the first interface is true */
|
||||||
|
|||||||
Reference in New Issue
Block a user