From patchwork Fri Jan 9 23:57:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 42917 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EA5ED2055F for ; Fri, 9 Jan 2015 23:57:57 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id gd6sf9302024lab.0 for ; Fri, 09 Jan 2015 15:57:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=JPFmEubqV6eI+JMHo7iZErz+AXEwDPKLOSB4O/0UA/w=; b=JFhsyMsAZQUhbUGnQ6OBFIbiLocpdH8qmmUv/YMCQC4bYl6RKxB+ADsF76cxlXgs4h gndbVgpNpoxa1ZhW78e3MB4vz3lVUtTCB52JqWGUxY0fkgZv6e3vXj7EQRn4kGhJT4VU TP29mWFwo1jUZrO+M8e8n6EmEQcTkW3wtUCrJ/f3ZB5gZpHUx8AQJnj0CPfcVM9sNEM0 9QJ69OSpLqxN9cnBmbeN7gnmCQvMTxX7ygIqsBthcymvN3Lc7N0EQkCHuBV6+9AJR9+y I0QtbWHkCQx3o84+UuSKWE+/4GGyd0yxtcmAXki5YCIbfYVCuNtg+jt1YQ1sDF2UGm4L Ci2Q== X-Gm-Message-State: ALoCoQne2xKI10KAgGMQTt4/ReCZPWFjAjCq49xTDimlzs4LbUhNZ8iL0hlewRGuh9tDwk2Lu01D X-Received: by 10.180.98.165 with SMTP id ej5mr758641wib.1.1420847876952; Fri, 09 Jan 2015 15:57:56 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.41 with SMTP id k9ls447562lae.104.gmail; Fri, 09 Jan 2015 15:57:56 -0800 (PST) X-Received: by 10.152.197.5 with SMTP id iq5mr24292783lac.6.1420847876692; Fri, 09 Jan 2015 15:57:56 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id jc7si14563924lbc.80.2015.01.09.15.57.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Jan 2015 15:57:56 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id gf13so16932438lab.7 for ; Fri, 09 Jan 2015 15:57:56 -0800 (PST) X-Received: by 10.112.98.99 with SMTP id eh3mr24097023lbb.32.1420847876272; Fri, 09 Jan 2015 15:57:56 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp479142lbb; Fri, 9 Jan 2015 15:57:55 -0800 (PST) X-Received: by 10.70.33.228 with SMTP id u4mr27763530pdi.146.1420847872033; Fri, 09 Jan 2015 15:57:52 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id py12si15404548pab.43.2015.01.09.15.57.51; Fri, 09 Jan 2015 15:57:52 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755994AbbAIX5p (ORCPT + 27 others); Fri, 9 Jan 2015 18:57:45 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:36293 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753878AbbAIX5g (ORCPT ); Fri, 9 Jan 2015 18:57:36 -0500 Received: by mail-pa0-f47.google.com with SMTP id kq14so21271002pab.6 for ; Fri, 09 Jan 2015 15:57:35 -0800 (PST) X-Received: by 10.66.119.239 with SMTP id kx15mr27812105pab.11.1420847855815; Fri, 09 Jan 2015 15:57:35 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [70.73.24.112]) by mx.google.com with ESMTPSA id od13sm8108693pdb.18.2015.01.09.15.57.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Jan 2015 15:57:35 -0800 (PST) From: mathieu.poirier@linaro.org To: gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org Subject: [PATCH 01/11] coresight-etm: unlock on error paths in mode_store() Date: Fri, 9 Jan 2015 16:57:12 -0700 Message-Id: <1420847842-31769-2-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1420847842-31769-1-git-send-email-mathieu.poirier@linaro.org> References: <1420847842-31769-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mathieu.poirier@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Dan Carpenter There are some missing unlocks on the error paths. Fixes: a939fc5a71ad ('coresight-etm: add CoreSight ETM/PTM driver') Signed-off-by: Dan Carpenter Signed-off-by: Mathieu Poirier --- drivers/coresight/coresight-etm3x.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/coresight/coresight-etm3x.c b/drivers/coresight/coresight-etm3x.c index d9e3ed6aa857..369cac00afaa 100644 --- a/drivers/coresight/coresight-etm3x.c +++ b/drivers/coresight/coresight-etm3x.c @@ -573,7 +573,8 @@ static ssize_t mode_store(struct device *dev, if (drvdata->mode & ETM_MODE_STALL) { if (!(drvdata->etmccr & ETMCCR_FIFOFULL)) { dev_warn(drvdata->dev, "stall mode not supported\n"); - return -EINVAL; + ret = -EINVAL; + goto err_unlock; } drvdata->ctrl |= ETMCR_STALL_MODE; } else @@ -582,7 +583,8 @@ static ssize_t mode_store(struct device *dev, if (drvdata->mode & ETM_MODE_TIMESTAMP) { if (!(drvdata->etmccer & ETMCCER_TIMESTAMP)) { dev_warn(drvdata->dev, "timestamp not supported\n"); - return -EINVAL; + ret = -EINVAL; + goto err_unlock; } drvdata->ctrl |= ETMCR_TIMESTAMP_EN; } else @@ -595,6 +597,10 @@ static ssize_t mode_store(struct device *dev, spin_unlock(&drvdata->spinlock); return size; + +err_unlock: + spin_unlock(&drvdata->spinlock); + return ret; } static DEVICE_ATTR_RW(mode);