|
@@ -304,18 +304,18 @@ static int stub_recv_cmd_unlink(struct stub_device *sdev,
|
|
|
static int valid_request(struct stub_device *sdev, struct usbip_header *pdu)
|
|
|
{
|
|
|
struct usbip_device *ud = &sdev->ud;
|
|
|
+ int valid = 0;
|
|
|
|
|
|
if (pdu->base.devid == sdev->devid) {
|
|
|
spin_lock(&ud->lock);
|
|
|
if (ud->status == SDEV_ST_USED) {
|
|
|
/* A request is valid. */
|
|
|
- spin_unlock(&ud->lock);
|
|
|
- return 1;
|
|
|
+ valid = 1;
|
|
|
}
|
|
|
spin_unlock(&ud->lock);
|
|
|
}
|
|
|
|
|
|
- return 0;
|
|
|
+ return valid;
|
|
|
}
|
|
|
|
|
|
static struct stub_priv *stub_priv_alloc(struct stub_device *sdev,
|