From patchwork Tue Mar 9 20:08:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 84398 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 o29K8LSe031978 for ; Tue, 9 Mar 2010 20:08:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754383Ab0CIUIU (ORCPT ); Tue, 9 Mar 2010 15:08:20 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:44673 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751494Ab0CIUIU (ORCPT ); Tue, 9 Mar 2010 15:08:20 -0500 Received: from dlep34.itg.ti.com ([157.170.170.115]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o29K8Jgp006298 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 9 Mar 2010 14:08:19 -0600 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id o29K8JqQ011733; Tue, 9 Mar 2010 14:08:19 -0600 (CST) Received: from gt516km11.gt.design.ti.com (gt516km11.gt.design.ti.com [158.218.100.179]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o29K8IZ20652; Tue, 9 Mar 2010 14:08:18 -0600 (CST) Received: from gt516km11.gt.design.ti.com (localhost.localdomain [127.0.0.1]) by gt516km11.gt.design.ti.com (8.13.1/8.13.1) with ESMTP id o29K8I4O031131; Tue, 9 Mar 2010 15:08:18 -0500 Received: (from a0868495@localhost) by gt516km11.gt.design.ti.com (8.13.1/8.13.1/Submit) id o29K8Iqh031128; Tue, 9 Mar 2010 15:08:18 -0500 X-Authentication-Warning: gt516km11.gt.design.ti.com: a0868495 set sender to m-karicheri2@ti.com using -f From: m-karicheri2@ti.com To: linux-media@vger.kernel.org Cc: Murali Karicheri Subject: [PATCH - FIX] V4L: vpfe_capture - free ccdc_lock when memory allocation fails Date: Tue, 9 Mar 2010 15:08:18 -0500 Message-Id: <1268165298-31094-1-git-send-email-m-karicheri2@ti.com> X-Mailer: git-send-email 1.6.0.4 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]); Tue, 09 Mar 2010 20:08:22 +0000 (UTC) diff --git a/drivers/media/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c index 885cd54..91f665b 100644 --- a/drivers/media/video/davinci/vpfe_capture.c +++ b/drivers/media/video/davinci/vpfe_capture.c @@ -1829,7 +1829,7 @@ static __init int vpfe_probe(struct platform_device *pdev) if (NULL == ccdc_cfg) { v4l2_err(pdev->dev.driver, "Memory allocation failed for ccdc_cfg\n"); - goto probe_free_dev_mem; + goto probe_free_lock; } strncpy(ccdc_cfg->name, vpfe_cfg->ccdc, 32); @@ -1981,8 +1981,9 @@ probe_out_video_release: probe_out_release_irq: free_irq(vpfe_dev->ccdc_irq0, vpfe_dev); probe_free_ccdc_cfg_mem: - mutex_unlock(&ccdc_lock); kfree(ccdc_cfg); +probe_free_lock: + mutex_unlock(&ccdc_lock); probe_free_dev_mem: kfree(vpfe_dev); return ret;