aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/stk-webcam.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c
index f1d5b3eaa192..edaea4964513 100644
--- a/drivers/media/video/stk-webcam.c
+++ b/drivers/media/video/stk-webcam.c
@@ -559,7 +559,7 @@ static void stk_clean_iso(struct stk_camera *dev)
559 559
560 urb = dev->isobufs[i].urb; 560 urb = dev->isobufs[i].urb;
561 if (urb) { 561 if (urb) {
562 if (atomic_read(&dev->urbs_used)) 562 if (atomic_read(&dev->urbs_used) && is_present(dev))
563 usb_kill_urb(urb); 563 usb_kill_urb(urb);
564 usb_free_urb(urb); 564 usb_free_urb(urb);
565 } 565 }
@@ -688,18 +688,14 @@ static int v4l_stk_release(struct inode *inode, struct file *fp)
688{ 688{
689 struct stk_camera *dev = fp->private_data; 689 struct stk_camera *dev = fp->private_data;
690 690
691 if (dev->owner != fp) { 691 if (dev->owner == fp) {
692 usb_autopm_put_interface(dev->interface); 692 stk_stop_stream(dev);
693 return 0; 693 stk_free_buffers(dev);
694 dev->owner = NULL;
694 } 695 }
695 696
696 stk_stop_stream(dev); 697 if(is_present(dev))
697 698 usb_autopm_put_interface(dev->interface);
698 stk_free_buffers(dev);
699
700 dev->owner = NULL;
701
702 usb_autopm_put_interface(dev->interface);
703 699
704 return 0; 700 return 0;
705} 701}