@@ -697,10 +697,9 @@ static int go7007_usb_ezusb_write_interrupt(struct go7007 *go,
}
if (r < 0)
goto write_int_error;
- if (i == 100) {
- dev_err(go->dev, "device is hung, status reg = 0x%04x\n", status_reg);
- return -1;
- }
+ if (i == 100)
+ goto dev_is_hung;
+
r = usb_control_msg(usb->usbdev, usb_sndctrlpipe(usb->usbdev, 0), 0x12,
USB_TYPE_VENDOR | USB_RECIP_DEVICE, data,
INT_PARAM_ADDR, NULL, 0, timeout);
@@ -716,6 +715,10 @@ static int go7007_usb_ezusb_write_interrupt(struct go7007 *go,
write_int_error:
dev_err(go->dev, "error in WriteInterrupt: %d\n", r);
return r;
+
+dev_is_hung:
+ dev_err(go->dev, "device is hung, status reg = 0x%04x\n", status_reg);
+ return -1;
}
static int go7007_usb_onboard_write_interrupt(struct go7007 *go,
Most of the time the same unwind code was used for errors, except in one case where it just returned. But smatch didn't like that, so make a new goto label for that situation. This fixes this smatch warning: go7007-usb.c:702 go7007_usb_ezusb_write_interrupt() warn: missing unwind goto? Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> --- drivers/media/usb/go7007/go7007-usb.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)