From: Perceval Anichini Date: Mon, 5 Jul 2010 18:11:51 +0000 (-0300) Subject: V4L/DVB: hdpvr: Fixes probing function X-Git-Tag: v2.6.36-rc1~582^2~111 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=07204aea1454db404141e95fc124536a6e0f6aa0;p=karo-tx-linux.git V4L/DVB: hdpvr: Fixes probing function 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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c index 830d47b05e1d..0cae5b82e1a2 100644 --- a/drivers/media/video/hdpvr/hdpvr-core.c +++ b/drivers/media/video/hdpvr/hdpvr-core.c @@ -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"); @@ -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); }