From patchwork Tue Sep 1 15:10:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 310255 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=unavailable 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 2D02DC433E6 for ; Tue, 1 Sep 2020 16:57:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 069A4206C0 for ; Tue, 1 Sep 2020 16:57:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598979446; bh=YgC0YRxiUO8aFLyonSNozBZtblQ0WwwViSlbYTEgmFc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=F5RSoLo1WvPegPzSZ3OdwewSO9qF3A+L/0Ksqpm+JVf8P0QVjbzabexDKGh7tBf9e PaZWwpLZFi0m8JCDakbtj6edl8WtBTZsgLjBZeMCoG5/WMiuSOQ0liWrDThB/ILsAq np59KinX3B1NlifBJW988k1TjC9i0UFjj83XrOOs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729636AbgIAQ5W (ORCPT ); Tue, 1 Sep 2020 12:57:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:46584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729272AbgIAPXa (ORCPT ); Tue, 1 Sep 2020 11:23:30 -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 09799206FA; Tue, 1 Sep 2020 15:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598973809; bh=YgC0YRxiUO8aFLyonSNozBZtblQ0WwwViSlbYTEgmFc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o7JDLNRNUoPZ107GH3O8VZ8xNRMQdS/17AOTQ4spmZgaFPcL41qpLqzMX2UgRf3no iP4x0WZ0QrhbnqG8tHPbO1bxGRgf5kpULYBIR1lH7/g0ruhCIKueENnPFBwqzNlOMf Jlyj41fNfMLDmhEDddtlFReBCIOdXQlmvZqxdxSo= 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 4.19 055/125] nvme-fc: Fix wrong return value in __nvme_fc_init_request() Date: Tue, 1 Sep 2020 17:10:10 +0200 Message-Id: <20200901150937.251719140@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901150934.576210879@linuxfoundation.org> References: <20200901150934.576210879@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 ed43b06353a39..bb3b447c56468 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -1716,7 +1716,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; } @@ -1726,7 +1726,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);