Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f051ae18 authored by David Ellingsworth's avatar David Ellingsworth Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (9194): stk-webcam: fix crash on close after disconnect



This patch prevents stk-webcam from updating usb device information
once the camera has been removed. This prevents a crash that would
otherwise occur if the camera is disconnected while it is still in
use.

Signed-off-by: default avatarDavid Ellingsworth <david@identd.dyndns.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 081d868f
Loading
Loading
Loading
Loading
+7 −11
Original line number Diff line number Diff line
@@ -559,7 +559,7 @@ static void stk_clean_iso(struct stk_camera *dev)

		urb = dev->isobufs[i].urb;
		if (urb) {
			if (atomic_read(&dev->urbs_used))
			if (atomic_read(&dev->urbs_used) && is_present(dev))
				usb_kill_urb(urb);
			usb_free_urb(urb);
		}
@@ -688,17 +688,13 @@ static int v4l_stk_release(struct inode *inode, struct file *fp)
{
	struct stk_camera *dev = fp->private_data;

	if (dev->owner != fp) {
		usb_autopm_put_interface(dev->interface);
		return 0;
	}

	if (dev->owner == fp) {
		stk_stop_stream(dev);

		stk_free_buffers(dev);

		dev->owner = NULL;
	}

	if(is_present(dev))
		usb_autopm_put_interface(dev->interface);

	return 0;