From patchwork Fri Feb 19 09:23:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 585090 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 30FA414031E for ; Fri, 19 Feb 2016 20:23:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=uXJIcyrZ; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161659AbcBSJXM (ORCPT ); Fri, 19 Feb 2016 04:23:12 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:32804 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161093AbcBSJXJ (ORCPT ); Fri, 19 Feb 2016 04:23:09 -0500 Received: by mail-pa0-f53.google.com with SMTP id fl4so47495845pad.0; Fri, 19 Feb 2016 01:23:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=gb/uOtu1NgQKbcRwU5ojy4Yv6SF9tp8+LA68llhHEkg=; b=uXJIcyrZOylwBQG1aXUj3FUaYFqm5DnDuKy00GIoSWphi5oCO/DdgFYzQ6Ge1DCVzh 7Hjn715YdcN3A2Bf0RhjCCmO2zXdyFCTLVCxh7O1vJ8S9eG/ZnBncL3sszdC3ENyk8lN kYlHsAp5Dn7awDytBC0TCQFwagjYzRreo7m7gF8DPwoHRtfe7dZ1uKO0oW14HStfmN5y ghRnew96Iel3hNXt7JRKce75R8sG3GHVxU+ybVOe9rEMzf/YsEbJ0cx2xRd7IKSXnusa 6VfgfvJOSiWIkk7i9rCF2s/ORbyqva6OjM8QJIZgutxBh8UT/i1LsiEv1BWTEJdyfixL NJVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gb/uOtu1NgQKbcRwU5ojy4Yv6SF9tp8+LA68llhHEkg=; b=GLQga0oiEQq1TrBxE0BKjsamBcTMIfbsMZ3HyW8AXZJY2aCi7HEkhay5ZrNp+6olrU 4keVyh075BNfTW/4LN069fOcaFkmlLKyc2CDOD1BS5lrXyjferyvYSLzr1QBi5L4YMOE CjAJyJBfq1rX32ZtTnP6mATj2V5dIyC+nVEyhY8pprurY+ZFfdYsjC0Yx6XnOz05Wp/h G2jVmnILwxtHYFmayvLbXb2M9Yk/ZX0kEImsKFQAgOZXHmZsKgZPGoWfO4Kwt6qG9fyp dhzBoK8mJ/0fQKHuUehw/JO6ix6xFUF0LP6kM8Aj/HPHuc3RcNWsz3JmBdzhEkjwEC1g 4asg== X-Gm-Message-State: AG10YOQzejGN6ffJVroWw/xBdKx/8HY3uyVynXWCC8hmFKXAdZfIfxXVx1ElFUHfAWS63w== X-Received: by 10.66.193.161 with SMTP id hp1mr16649513pac.9.1455873789025; Fri, 19 Feb 2016 01:23:09 -0800 (PST) Received: from sudip-pc.vectortproxy.org ([14.195.224.162]) by smtp.gmail.com with ESMTPSA id 87sm16077698pfq.93.2016.02.19.01.23.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Feb 2016 01:23:08 -0800 (PST) From: Sudip Mukherjee To: Linus Walleij , Alexandre Courbot Cc: linux-kernel@vger.kernel.org, "Andrew F. Davis" , linux-gpio@vger.kernel.org, Sudip Mukherjee Subject: [PATCH] gpio: pisosr: add missing unlock Date: Fri, 19 Feb 2016 14:53:00 +0530 Message-Id: <1455873780-31935-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org If spi_read() fails then we just returned but we missed unlocking the mutex. Signed-off-by: Sudip Mukherjee --- drivers/gpio/gpio-pisosr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-pisosr.c b/drivers/gpio/gpio-pisosr.c index 58ea08d..f9f1074 100644 --- a/drivers/gpio/gpio-pisosr.c +++ b/drivers/gpio/gpio-pisosr.c @@ -53,12 +53,10 @@ static int pisosr_gpio_refresh(struct pisosr_gpio *gpio) } ret = spi_read(gpio->spi, gpio->buffer, gpio->buffer_size); - if (ret) - return ret; mutex_unlock(&gpio->lock); - return 0; + return ret; } static int pisosr_gpio_get_direction(struct gpio_chip *chip,