From patchwork Wed Jun 2 14:04:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Perceval Anichini X-Patchwork-Id: 103814 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o52E56PI029469 for ; Wed, 2 Jun 2010 14:05:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757125Ab0FBOFE (ORCPT ); Wed, 2 Jun 2010 10:05:04 -0400 Received: from smtpfb1-g21.free.fr ([212.27.42.9]:46397 "EHLO smtpfb1-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756795Ab0FBOFB (ORCPT ); Wed, 2 Jun 2010 10:05:01 -0400 Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) by smtpfb1-g21.free.fr (Postfix) with ESMTP id 1AE3C77C588 for ; Wed, 2 Jun 2010 16:04:56 +0200 (CEST) Received: from [192.168.168.1] (guy78-3-82-239-224-122.fbx.proxad.net [82.239.224.122]) by smtp2-g21.free.fr (Postfix) with ESMTP id 726A34B018E for ; Wed, 2 Jun 2010 16:04:20 +0200 (CEST) Message-ID: <4C0664E2.4080003@trilogic.fr> Date: Wed, 02 Jun 2010 16:04:18 +0200 From: Perceval Anichini User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: "linux-media@vger.kernel.org" Subject: [PATCH] hdpvr: Fixes probing function. Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 02 Jun 2010 14:05:06 +0000 (UTC) From: Perceval Anichini 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 --- diff -r 304cfde05b3f linux/drivers/media/video/hdpvr/hdpvr-core.c --- a/linux/drivers/media/video/hdpvr/hdpvr-core.c Tue May 25 23:50:51 2010 -0400 +++ b/linux/drivers/media/video/hdpvr/hdpvr-core.c Wed Jun 02 15:42:17 2010 +0200 @@ -286,6 +286,8 @@ 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 @@ error: if (dev) { + /* Destroy single thread */ + if (dev->workqueue) + destroy_workqueue(dev->workqueue); /* this frees allocated memory */ hdpvr_delete(dev); }