Commit d5e50611 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: fix 2 locking bugs in usbtest.c as found by sparse

Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 8fd5592c
......@@ -1355,7 +1355,7 @@ static void iso_callback (struct urb *urb, struct pt_regs *regs)
"iso test, %lu errors\n",
ctx->errors);
complete (&ctx->done);
} else
}
done:
spin_unlock(&ctx->lock);
}
......@@ -1457,8 +1457,10 @@ test_iso_queue (struct usbtest_dev *dev, struct usbtest_param *param,
status = usb_submit_urb (urbs [i], SLAB_ATOMIC);
if (status < 0) {
ERROR (dev, "submit iso[%d], error %d\n", i, status);
if (i == 0)
if (i == 0) {
spin_unlock_irq (&context.lock);
goto fail;
}
simple_free_urb (urbs [i]);
context.pending--;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment