Skip to content

Commit

Permalink
V4L/DVB: hdpvr: Fixes probing function
Browse files Browse the repository at this point in the history
In the hdpvr_probe () function, when an error occurs while probing the device,
the workqueue created by the create_single_thread () call is not properly
destroyed.

Signed-off-by: Perceval Anichini <perceval@trilogic.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Perceval Anichini authored and Mauro Carvalho Chehab committed Aug 2, 2010
1 parent fe85ce9 commit 07204ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/media/video/hdpvr/hdpvr-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ static int hdpvr_probe(struct usb_interface *interface,
goto error;
}

dev->workqueue = 0;

/* register v4l2_device early so it can be used for printks */
if (v4l2_device_register(&interface->dev, &dev->v4l2_dev)) {
err("v4l2_device_register failed");
Expand Down Expand Up @@ -380,6 +382,9 @@ static int hdpvr_probe(struct usb_interface *interface,

error:
if (dev) {
/* Destroy single thread */
if (dev->workqueue)
destroy_workqueue(dev->workqueue);
/* this frees allocated memory */
hdpvr_delete(dev);
}
Expand Down

0 comments on commit 07204ae

Please sign in to comment.