[PATCH 14/17] media: usb: go7007: add second unwind label

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 drivers/media/usb/go7007/go7007-usb.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/media/usb/go7007/go7007-usb.c b/drivers/media/usb/go7007/go7007-usb.c
index eeb85981e02b..d8524d761c32 100644
--- a/drivers/media/usb/go7007/go7007-usb.c
+++ b/drivers/media/usb/go7007/go7007-usb.c
@@ -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,
-- 
2.39.0




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux