Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1829082imm; Mon, 3 Sep 2018 10:30:11 -0700 (PDT) X-Google-Smtp-Source: ANB0VdazIK+/jIu7o08FyQjSrMLufTtM666ha+BSElbnmkUIP6cMudqUONGTwvnqTrat7zhAb0Li X-Received: by 2002:a65:6143:: with SMTP id o3-v6mr28009803pgv.52.1535995811177; Mon, 03 Sep 2018 10:30:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995811; cv=none; d=google.com; s=arc-20160816; b=QmM93If8uA4+l+KANdpNcuF1nS7RmJEnYhv5rwdyvcffetSJt4iwj4NvrkEQJqXvq9 qjoJute05cmX3vL+toJlDse2sNVGpXJSCciN55N8QPyACMysYMFql49x5AvTzT2HLcYQ Kr6suUtQ/Cw4yWmED1nB+Gnf50R4BakGuuB/FX3EU/Ca5RqI7zLj8URl9PAxO0tLZZ9n ClCF1aQeK7MMuxxlo15UfdZmwokTKwqNo4v5aoancKGaNbP7gvmrM5JCbaZrWTmPhD0A cEFLszijBhRqExVYGg3EtAIExmeR+g72GZMAN2L7/mTWjg6sotRjOkPSP/igSuwW5JtH a7wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=DtawtthmV3WHtyHC04mBaJVbIgqu7AlCwxhgf1YYfxw=; b=n2zvtlrqiqIhO5rt6woGGE8HBhP81c5LlDqiD5u/b9eD0Yg4AeuMWN57jcomy56Ofu Vo9DV5njniofQN8/61Dh0enTh7+H3OSRklnJb3GgWSQ3OltAwwtE1XKkydEifOJEVWk/ K2Sq1Zl5jN4X7/AoH8Zs8p9xPCTyuHfPZvOyVuLUNQIuNh60cwwMHzmGnswT5SRA8LDg +6VwUlNt/D4Qec6cXkHSDzRHCfsp+ROIBVQrSY9hjr+mXuNcHBFn2UsgblfxwOu22kU/ Yb+TJYUL2Oe6izdzB0hFI1+5k7BJkQl72QmK2znZj4NahN+wrpRzVxSkMFsnNaru0fVm JNfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 7-v6si17792132pgw.207.2018.09.03.10.29.56; Mon, 03 Sep 2018 10:30:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731067AbeICVst (ORCPT + 99 others); Mon, 3 Sep 2018 17:48:49 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46316 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728175AbeICVss (ORCPT ); Mon, 3 Sep 2018 17:48:48 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 61962D01; Mon, 3 Sep 2018 17:27:40 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bart Van Assche , Christoph Hellwig , Sathya Prakash , Chaitra P B , Suganath Prabu Subramani , "Martin K. Petersen" Subject: [PATCH 4.14 154/165] scsi: mpt3sas: Fix _transport_smp_handler() error path Date: Mon, 3 Sep 2018 18:57:20 +0200 Message-Id: <20180903165704.813212166@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bart Van Assche commit 91b7bdb2c0089cbbb817df6888ab1458c645184e upstream. This patch avoids that smatch complains about a double unlock on ioc->transport_cmds.mutex. Fixes: 651a01364994 ("scsi: scsi_transport_sas: switch to bsg-lib for SMP passthrough") Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Sathya Prakash Cc: Chaitra P B Cc: Suganath Prabu Subramani Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/mpt3sas/mpt3sas_transport.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/scsi/mpt3sas/mpt3sas_transport.c +++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c @@ -1936,12 +1936,12 @@ _transport_smp_handler(struct bsg_job *j pr_info(MPT3SAS_FMT "%s: host reset in progress!\n", __func__, ioc->name); rc = -EFAULT; - goto out; + goto job_done; } rc = mutex_lock_interruptible(&ioc->transport_cmds.mutex); if (rc) - goto out; + goto job_done; if (ioc->transport_cmds.status != MPT3_CMD_NOT_USED) { pr_err(MPT3SAS_FMT "%s: transport_cmds in use\n", ioc->name, @@ -2066,6 +2066,7 @@ _transport_smp_handler(struct bsg_job *j out: ioc->transport_cmds.status = MPT3_CMD_NOT_USED; mutex_unlock(&ioc->transport_cmds.mutex); +job_done: bsg_job_done(job, rc, reslen); }