From patchwork Thu Feb 14 09:00:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 2140831 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 57659DF283 for ; Thu, 14 Feb 2013 09:04:02 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U5ugO-0003zk-Hn; Thu, 14 Feb 2013 09:00:44 +0000 Received: from mga02.intel.com ([134.134.136.20]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U5ugL-0003zA-FF for linux-arm-kernel@lists.infradead.org; Thu, 14 Feb 2013 09:00:42 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 14 Feb 2013 01:00:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,662,1355126400"; d="scan'208";a="285631041" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.173]) by orsmga002.jf.intel.com with ESMTP; 14 Feb 2013 01:00:36 -0800 Received: from andy by smile with local (Exim 4.80) (envelope-from ) id 1U5ug3-0001fJ-88; Thu, 14 Feb 2013 11:00:23 +0200 From: Andy Shevchenko To: Vinod Koul , linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH v2 3/6] dma: coh901318: avoid unbalanced locking Date: Thu, 14 Feb 2013 11:00:17 +0200 Message-Id: <1360832420-6349-4-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360832420-6349-1-git-send-email-andriy.shevchenko@linux.intel.com> References: <1360832420-6349-1-git-send-email-andriy.shevchenko@linux.intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130214_040041_595828_8021A098 X-CRM114-Status: GOOD ( 12.49 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [134.134.136.20 listed in list.dnswl.org] -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Linus Walleij , Andy Shevchenko , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In case the len is 0 we must return without trying to unlock the lock that was not locked. Signed-off-by: Andy Shevchenko Acked-by: Viresh Kumar Cc: Linus Walleij Cc: linux-arm-kernel@lists.infradead.org --- drivers/dma/coh901318_lli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/coh901318_lli.c b/drivers/dma/coh901318_lli.c index 780e042..fe9cc5e 100644 --- a/drivers/dma/coh901318_lli.c +++ b/drivers/dma/coh901318_lli.c @@ -61,7 +61,7 @@ coh901318_lli_alloc(struct coh901318_pool *pool, unsigned int len) dma_addr_t phy; if (len == 0) - goto err; + return NULL; spin_lock(&pool->lock);