mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 11:21:26 -04:00
media: rc: streamzap: Error handling in probe
If submitting the URB fails, the device will be unusable.
Probe() must fail.
Fixes: 7a569f524d ("V4L/DVB: IR/streamzap: functional in-kernel decoding")
Cc: stable@vger.kernel.org
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
committed by
Hans Verkuil
parent
dccc0c3ddf
commit
4284499266
@@ -219,9 +219,8 @@ static void streamzap_callback(struct urb *urb)
|
||||
case -ESHUTDOWN:
|
||||
/*
|
||||
* this urb is terminated, clean up.
|
||||
* sz might already be invalid at this point
|
||||
*/
|
||||
dev_err(sz->dev, "urb terminated, status: %d\n", urb->status);
|
||||
dev_dbg(sz->dev, "urb terminated, status: %d\n", urb->status);
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
@@ -358,11 +357,16 @@ static int streamzap_probe(struct usb_interface *intf,
|
||||
|
||||
usb_set_intfdata(intf, sz);
|
||||
|
||||
if (usb_submit_urb(sz->urb_in, GFP_ATOMIC))
|
||||
retval = usb_submit_urb(sz->urb_in, GFP_ATOMIC);
|
||||
if (retval < 0) {
|
||||
dev_err(sz->dev, "urb submit failed\n");
|
||||
goto rc_submit_fail;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
rc_submit_fail:
|
||||
rc_free_device(sz->rdev);
|
||||
usb_set_intfdata(intf, NULL);
|
||||
rc_dev_fail:
|
||||
usb_free_urb(sz->urb_in);
|
||||
free_buf_in:
|
||||
|
||||
Reference in New Issue
Block a user