Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2253644ybd; Mon, 24 Jun 2019 03:22:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDA48B8LxSsOVR49SC7yZFlzrorm39ooa6r1nr1tUERMq0kDg3fGycrlucAEE/DAqBq6zm X-Received: by 2002:a17:90a:db42:: with SMTP id u2mr24088916pjx.48.1561371726544; Mon, 24 Jun 2019 03:22:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561371726; cv=none; d=google.com; s=arc-20160816; b=KmAz/6yCW8Zysefrq9M5sQHmKIybmJIGPnDYDoL5tXAzzl4zuh/776DW4/mh7PVK6M zlDXcr/k8LPIWGOifzr3iluuCbmJlr+w/NGgJEmA1iBi2Xl2/bome4B4AIlLfj55T6ih yZFoe07f4do/zsYYlp6mhWW2f7343lyMzBUMW1AW9tNmIp39gaUYC809CGDknk7mE/+U EBJZQGAoYroAvR0NPHX1aUhaZgY9fXO5Em6mICY6dXiwsLS3vT9Pnc+KBv6E1Du2yYBw Akp8OKcCiyni9InN98n4T0kP+sg/Jms20aLYIibbuqr4dMstuRA8H0NPIagZ4plppS65 d39Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nco+zs6NpIi7599wjd2sRuxJ4SjLWcXxebEj564IcWc=; b=J4aTXMC/FDIHC00rDu6kGWDr7gitcd6HBGHHILWZnP/y0wnu6txQBbtQRL6tAoRgck RW3gB9FntcaafGXp0kVvCrjqZx6uRDwKeLm7dnDzZ+VFAsn45bR+P22c6ij7CxgsePpE 8mrn4VSE9InjRZ7KWcvYLoOzJepIAvkvn2PhOr5BXr7dwifTgGtxuiqsU4BO5bNlrPJl mySGWHmYQ57Houj1CHBh1Ob+m18XTxoLvk2lMLMLbgLC7dlYBSj+q3CGYhmbGaD3n29B NnDmbzsqNL96tnpOA/2XpbB5r4K48BdRmLnb/bHvfhDKexcioG7v54ybYcqChh6o2+vA TgAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M5izVy5F; 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 62si10507437pgc.47.2019.06.24.03.21.50; Mon, 24 Jun 2019 03:22:06 -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; dkim=pass header.i=@kernel.org header.s=default header.b=M5izVy5F; 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 S1729904AbfFXKVi (ORCPT + 99 others); Mon, 24 Jun 2019 06:21:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:57310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727525AbfFXKVh (ORCPT ); Mon, 24 Jun 2019 06:21:37 -0400 Received: from localhost (f4.8f.5177.ip4.static.sl-reverse.com [119.81.143.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 429B620645; Mon, 24 Jun 2019 10:21:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561371696; bh=auMCal2LoCfpgKRPytluCTINv39Soo4TNSQ4RmUdg4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M5izVy5F90M9pdtDShbt6Dnwc8AK5uefB287sp2U6RSGPdsqNinS/+G/qDwF4YxcZ 6s/GmdbZdGRsK0aBgH0b6t2xMluk0HvTGQzWT1bnYBCnKjfad6v8n0DqgTObfzhztV lzQXLReCmz9GufIFxVvRCArUiJoyv6zMxjqZudvY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Don Brace , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.1 078/121] scsi: smartpqi: unlock on error in pqi_submit_raid_request_synchronous() Date: Mon, 24 Jun 2019 17:56:50 +0800 Message-Id: <20190624092324.865190248@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190624092320.652599624@linuxfoundation.org> References: <20190624092320.652599624@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit cc8f52609bb4177febade24d11713e20c0893b0a ] We need to drop the "ctrl_info->sync_request_sem" lock before returning. Fixes: 6c223761eb54 ("smartpqi: initial commit of Microsemi smartpqi driver") Signed-off-by: Dan Carpenter Acked-by: Don Brace Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/smartpqi/smartpqi_init.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 531824afba5f..392695b4691a 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -4044,8 +4044,10 @@ static int pqi_submit_raid_request_synchronous(struct pqi_ctrl_info *ctrl_info, return -ETIMEDOUT; msecs_blocked = jiffies_to_msecs(jiffies - start_jiffies); - if (msecs_blocked >= timeout_msecs) - return -ETIMEDOUT; + if (msecs_blocked >= timeout_msecs) { + rc = -ETIMEDOUT; + goto out; + } timeout_msecs -= msecs_blocked; } } -- 2.20.1