Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142461
b: refs/heads/master
c: 65d9ff9
h: refs/heads/master
i:
  142459: c542b84
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Apr 7, 2009
1 parent 2c9e436 commit 414e2c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dfa76fa2824967c0ec196fbcba36d3e74b66d3aa
refs/heads/master: 65d9ff9c85d3c2e06d22aed78efee8404563eff6
11 changes: 8 additions & 3 deletions trunk/drivers/media/video/v4l2-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ static int v4l2_mmap(struct file *filp, struct vm_area_struct *vm)
static int v4l2_open(struct inode *inode, struct file *filp)
{
struct video_device *vdev;
int ret;
int ret = 0;

/* Check if the video device is available */
mutex_lock(&videodev_lock);
Expand All @@ -243,7 +243,9 @@ static int v4l2_open(struct inode *inode, struct file *filp)
/* and increase the device refcount */
video_get(vdev);
mutex_unlock(&videodev_lock);
ret = vdev->fops->open(filp);
if (vdev->fops->open)
ret = vdev->fops->open(filp);

/* decrease the refcount in case of an error */
if (ret)
video_put(vdev);
Expand All @@ -254,7 +256,10 @@ static int v4l2_open(struct inode *inode, struct file *filp)
static int v4l2_release(struct inode *inode, struct file *filp)
{
struct video_device *vdev = video_devdata(filp);
int ret = vdev->fops->release(filp);
int ret = 0;

if (vdev->fops->release)
vdev->fops->release(filp);

/* decrease the refcount unconditionally since the release()
return value is ignored. */
Expand Down

0 comments on commit 414e2c3

Please sign in to comment.