From patchwork Tue Sep 1 15:09:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 264725 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4585C433E2 for ; Tue, 1 Sep 2020 15:40:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D31621655 for ; Tue, 1 Sep 2020 15:40:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974802; bh=DTab96VhILBeUDIxYQXE9i5WqS67E0oy0oIj9su4RMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=w+3pnfwTjUK874wjI9Ifilc453nZ5qJZxP9mY0zPgYSgScp4XisZAI+zAOGWtgux+ m8bbBl6fm1QQVUvRraCNhHD2+qRU890+oDeY6b22rNamZLcng71qwoSiFur+ZGBJfl FEcF2CNk8BkVfVPnlQ5uxJxZNweHjNWLRBD7Rxew= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731486AbgIAPkA (ORCPT ); Tue, 1 Sep 2020 11:40:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:50550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731482AbgIAPj6 (ORCPT ); Tue, 1 Sep 2020 11:39:58 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 61B2821534; Tue, 1 Sep 2020 15:39:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974798; bh=DTab96VhILBeUDIxYQXE9i5WqS67E0oy0oIj9su4RMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rAg4hh0KUFV0GKqbwupVo3xwYnMIksa6Y2XLH0Pm5ZteDf0ECqCtxB5wirasTFfyN Atxhx7/dIKv4UEP2nJrVf8Kos5omWpPNOA1WnPgAlJLd1ZUVpDdZT36Q4ehrdZbndN Y4DDwevYy+aEMIX7a+kB6ZBoPqXGZNXqRqG/i/k4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Smart , Tianjia Zhang , Chaitanya Kulkarni , Christoph Hellwig , Sagi Grimberg , Jens Axboe , Sasha Levin Subject: [PATCH 5.8 095/255] nvme-fc: Fix wrong return value in __nvme_fc_init_request() Date: Tue, 1 Sep 2020 17:09:11 +0200 Message-Id: <20200901151005.276890097@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901151000.800754757@linuxfoundation.org> References: <20200901151000.800754757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tianjia Zhang [ Upstream commit f34448cd0dc697723fb5f4118f8431d9233b370d ] On an error exit path, a negative error code should be returned instead of a positive return value. Fixes: e399441de9115 ("nvme-fabrics: Add host support for FC transport") Cc: James Smart Signed-off-by: Tianjia Zhang Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Signed-off-by: Sagi Grimberg Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/nvme/host/fc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 549f5b0fb0b4b..1a2b6910509ca 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -2076,7 +2076,7 @@ __nvme_fc_init_request(struct nvme_fc_ctrl *ctrl, if (fc_dma_mapping_error(ctrl->lport->dev, op->fcp_req.cmddma)) { dev_err(ctrl->dev, "FCP Op failed - cmdiu dma mapping failed.\n"); - ret = EFAULT; + ret = -EFAULT; goto out_on_error; } @@ -2086,7 +2086,7 @@ __nvme_fc_init_request(struct nvme_fc_ctrl *ctrl, if (fc_dma_mapping_error(ctrl->lport->dev, op->fcp_req.rspdma)) { dev_err(ctrl->dev, "FCP Op failed - rspiu dma mapping failed.\n"); - ret = EFAULT; + ret = -EFAULT; } atomic_set(&op->state, FCPOP_STATE_IDLE);