From patchwork Tue Apr 9 05:15:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 2412941 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 9C5223FD8C for ; Tue, 9 Apr 2013 05:17:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753885Ab3DIFRr (ORCPT ); Tue, 9 Apr 2013 01:17:47 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:36698 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751300Ab3DIFRq (ORCPT ); Tue, 9 Apr 2013 01:17:46 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r395HeM8013807 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Apr 2013 05:17:40 GMT Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r395HdUp011241 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Apr 2013 05:17:39 GMT Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71]) by userz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r395HcFN017942; Tue, 9 Apr 2013 05:17:38 GMT Received: from longonot.mountain (/41.202.233.179) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Apr 2013 22:17:37 -0700 Date: Tue, 9 Apr 2013 08:15:40 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: Bill Pemberton , Hans Verkuil , "Lad, Prabhakar" , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] [media] dt3155v4l: unlock on error path Message-ID: <20130409051540.GA1516@longonot.mountain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org We should unlock here and do some cleanup before returning. We can't actually hit this return path with the current code, so this patch is a basically a cleanup and doesn't change how the code works. Signed-off-by: Dan Carpenter Nacked-by: Hans Verkuil --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/staging/media/dt3155v4l/dt3155v4l.c b/drivers/staging/media/dt3155v4l/dt3155v4l.c index 073b3b3..3da17bc 100644 --- a/drivers/staging/media/dt3155v4l/dt3155v4l.c +++ b/drivers/staging/media/dt3155v4l/dt3155v4l.c @@ -398,7 +398,7 @@ dt3155_open(struct file *filp) pd->field_count = 0; ret = vb2_queue_init(pd->q); if (ret < 0) - return ret; + goto err_free_q; INIT_LIST_HEAD(&pd->dmaq); spin_lock_init(&pd->lock); /* disable all irqs, clear all irq flags */ @@ -407,11 +407,11 @@ dt3155_open(struct file *filp) ret = request_irq(pd->pdev->irq, dt3155_irq_handler_even, IRQF_SHARED, DT3155_NAME, pd); if (ret) - goto err_request_irq; + goto err_free_q; } pd->users++; return 0; /* success */ -err_request_irq: +err_free_q: kfree(pd->q); pd->q = NULL; err_alloc_queue: