Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 161499
b: refs/heads/master
c: 00c1e21
h: refs/heads/master
i:
  161497: cb322e2
  161495: e6a3754
v: v3
  • Loading branch information
Jiri Slaby authored and Mauro Carvalho Chehab committed Sep 12, 2009
1 parent 953bc7b commit e9b3c35
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 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: b9ab3508efa57905ae037ddf48c97ea6ed74b799
refs/heads/master: 00c1e2167e3163d2e193644b7d768f06d2a8c279
12 changes: 6 additions & 6 deletions trunk/drivers/media/video/hdpvr/hdpvr-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static int device_authorization(struct hdpvr_device *dev)
char *print_buf = kzalloc(5*buf_size+1, GFP_KERNEL);
if (!print_buf) {
v4l2_err(&dev->v4l2_dev, "Out of memory\n");
goto error;
return retval;
}
#endif

Expand All @@ -140,7 +140,7 @@ static int device_authorization(struct hdpvr_device *dev)
if (ret != 46) {
v4l2_err(&dev->v4l2_dev,
"unexpected answer of status request, len %d\n", ret);
goto error;
goto unlock;
}
#ifdef HDPVR_DEBUG
else {
Expand All @@ -163,7 +163,7 @@ static int device_authorization(struct hdpvr_device *dev)
v4l2_err(&dev->v4l2_dev, "unknown firmware version 0x%x\n",
dev->usbc_buf[1]);
ret = -EINVAL;
goto error;
goto unlock;
}

response = dev->usbc_buf+38;
Expand All @@ -188,10 +188,10 @@ static int device_authorization(struct hdpvr_device *dev)
10000);
v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev,
"magic request returned %d\n", ret);
mutex_unlock(&dev->usbc_mutex);

retval = ret != 8;
error:
unlock:
mutex_unlock(&dev->usbc_mutex);
return retval;
}

Expand Down Expand Up @@ -350,6 +350,7 @@ static int hdpvr_probe(struct usb_interface *interface,

mutex_lock(&dev->io_mutex);
if (hdpvr_alloc_buffers(dev, NUM_BUFFERS)) {
mutex_unlock(&dev->io_mutex);
v4l2_err(&dev->v4l2_dev,
"allocating transfer buffers failed\n");
goto error;
Expand Down Expand Up @@ -381,7 +382,6 @@ static int hdpvr_probe(struct usb_interface *interface,

error:
if (dev) {
mutex_unlock(&dev->io_mutex);
/* this frees allocated memory */
hdpvr_delete(dev);
}
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/media/video/hdpvr/hdpvr-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ static int hdpvr_open(struct file *file)
* in resumption */
mutex_lock(&dev->io_mutex);
dev->open_count++;
mutex_unlock(&dev->io_mutex);

fh->dev = dev;

Expand All @@ -383,7 +384,6 @@ static int hdpvr_open(struct file *file)

retval = 0;
err:
mutex_unlock(&dev->io_mutex);
return retval;
}

Expand Down Expand Up @@ -519,8 +519,10 @@ static unsigned int hdpvr_poll(struct file *filp, poll_table *wait)

mutex_lock(&dev->io_mutex);

if (video_is_unregistered(dev->video_dev))
if (video_is_unregistered(dev->video_dev)) {
mutex_unlock(&dev->io_mutex);
return -EIO;
}

if (dev->status == STATUS_IDLE) {
if (hdpvr_start_streaming(dev)) {
Expand Down

0 comments on commit e9b3c35

Please sign in to comment.