From patchwork Tue Aug 14 06:59:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 1318431 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 B010D3FC81 for ; Tue, 14 Aug 2012 07:00:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752561Ab2HNHAB (ORCPT ); Tue, 14 Aug 2012 03:00:01 -0400 Received: from acsinet15.oracle.com ([141.146.126.227]:36919 "EHLO acsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751950Ab2HNHAA (ORCPT ); Tue, 14 Aug 2012 03:00:00 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q7E6xt9S032259 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 14 Aug 2012 06:59:56 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q7E6xsVI023680 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 14 Aug 2012 06:59:55 GMT Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q7E6xsYB028517; Tue, 14 Aug 2012 01:59:54 -0500 Received: from elgon.mountain (/41.212.103.53) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 13 Aug 2012 23:59:54 -0700 Date: Tue, 14 Aug 2012 09:59:48 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: Ezequiel Garcia , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] [media] stk1160: unlock on error path stk1160_set_alternate() Message-ID: <20120814065948.GD4791@elgon.mountain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org There are some unlocks missing on error. Signed-off-by: Dan Carpenter --- Applies on top of linux-next. -- 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/media/video/stk1160/stk1160-v4l.c b/drivers/media/video/stk1160/stk1160-v4l.c index 360bdbe..1ad4ac1 100644 --- a/drivers/media/video/stk1160/stk1160-v4l.c +++ b/drivers/media/video/stk1160/stk1160-v4l.c @@ -159,8 +159,9 @@ static bool stk1160_set_alternate(struct stk1160 *dev) static int stk1160_start_streaming(struct stk1160 *dev) { - int i, rc; bool new_pkt_size; + int rc = 0; + int i; /* Check device presence */ if (!dev->udev) @@ -183,7 +184,7 @@ static int stk1160_start_streaming(struct stk1160 *dev) if (!dev->isoc_ctl.num_bufs || new_pkt_size) { rc = stk1160_alloc_isoc(dev); if (rc < 0) - return rc; + goto out_unlock; } /* submit urbs and enables IRQ */ @@ -192,7 +193,7 @@ static int stk1160_start_streaming(struct stk1160 *dev) if (rc) { stk1160_err("cannot submit urb[%d] (%d)\n", i, rc); stk1160_uninit_isoc(dev); - return rc; + goto out_unlock; } } @@ -205,9 +206,10 @@ static int stk1160_start_streaming(struct stk1160 *dev) stk1160_dbg("streaming started\n"); +out_unlock: mutex_unlock(&dev->v4l_lock); - return 0; + return rc; } /* Must be called with v4l_lock hold */