From patchwork Thu May 20 09:20:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 444437 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=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 B410CC433B4 for ; Thu, 20 May 2021 10:00:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 91C9761CDD for ; Thu, 20 May 2021 10:00:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235091AbhETKCI (ORCPT ); Thu, 20 May 2021 06:02:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:59150 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235324AbhETJ7x (ORCPT ); Thu, 20 May 2021 05:59:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F073861883; Thu, 20 May 2021 09:38:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503535; bh=nJYuKBDy21ROuD2oBpZ2+sxuPbgro27WhZtPGJwL07I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VLW1pF3gyXDJ1whoJpOC99hq+PQG3AOBU6cghJ2IWqaTFUNC1ULS9VNW29LHj8V64 eB5RjR+nS16/4ezoBobpUnQ6Kpr0pduDPaMw5IZtRa0ZRsJtkQAqbIMor26Qgt/cEi dxW/5XJ+w5Ra4iM8ZCXy+3UhkwMpHdoxVod++HBE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wang Wensheng , Bart Van Assche , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.19 266/425] RDMA/srpt: Fix error return code in srpt_cm_req_recv() Date: Thu, 20 May 2021 11:20:35 +0200 Message-Id: <20210520092140.188575128@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Wang Wensheng [ Upstream commit 6bc950beff0c440ac567cdc4e7f4542a9920953d ] Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: db7683d7deb2 ("IB/srpt: Fix login-related race conditions") Link: https://lore.kernel.org/r/20210408113132.87250-1-wangwensheng4@huawei.com Reported-by: Hulk Robot Signed-off-by: Wang Wensheng Reviewed-by: Bart Van Assche Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/ulp/srpt/ib_srpt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index bc979a85a505..6090f1ce0c56 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -2301,6 +2301,7 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev, pr_info("rejected SRP_LOGIN_REQ because target %s_%d is not enabled\n", sdev->device->name, port_num); mutex_unlock(&sport->mutex); + ret = -EINVAL; goto reject; }