Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp533011pxb; Wed, 3 Mar 2021 09:02:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBnNZhaWcVUqDGqIhcWBlPMAbJ6WuVN13Iyf7EhxVTh9Gr/wfVLx2RkfABu/X0MeJ1ORFj X-Received: by 2002:a17:906:3881:: with SMTP id q1mr26763585ejd.490.1614790936538; Wed, 03 Mar 2021 09:02:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614790936; cv=none; d=google.com; s=arc-20160816; b=wP5osT7dpq4MlqTtTWPYFLAZTrkAsKR5dZYMUk03zMOFOrdjhotyhRE1bta63k9Egj BLiWZaIhQNH6UKMiudPdMBdE0+T8uNJe8CwSLg7NO9/wkQoz4BjGwLm4f1L7UmZKWp4G m+Y8LHb5qizjvRrvdOu+8IqQUwg3sECMJkPVJ5jpCv5+4mKsSH6pR4yrDsT8p/tEtY7R 4/DyHEBCRx79M0MjXp48sKseLQWXUsHiesHtkBPyX+qrI8XcdLl8Tri6HVwBmZuFxUpx ++yWdkxOQPCWsvLMOM350qn17nr4+zoBKhkbKbBB9yJNXeM+kXcusLW9qvnJlNTO4yS8 d09A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TCVzBSYYak6/jWUCPePkbVRf37CjlN6myvJYZHTgmps=; b=aFKQfUpmwErsKEuMo5SA3LX/y1KxTQwnMm5yQm3l1AHL2YzvtYPXMLBHRbTxVtZmoV 0od/j1kzQZYs8lp+0WkiBjZBetWH4YX+pjg/Z0D44PBSNejBHHYum17XC2fQzz6KIYjS IjMmfkfJ6i3ao4zYgxsi861pgjs8cGH/6gAQzBLIyEk8m/6WJ4W5tf3qPJZf/pdbnYBh 2asfqtNUDg493h5udi0oil/Lrs1Skg67sBDpbUnF47fx5ehQrHXTEJbi/CEmNQQ/3twM NhMqZlC20dsz0DoQkaXMXMMdpwEZWHXwrLXl5E7OqM35UERjXjfkQjerkfF26ETOgl0V ahCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kNPzBV51; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s10si2813816ejy.131.2021.03.03.09.01.11; Wed, 03 Mar 2021 09:02:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kNPzBV51; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348077AbhCBA2a (ORCPT + 99 others); Mon, 1 Mar 2021 19:28:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:43168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233289AbhCAS3G (ORCPT ); Mon, 1 Mar 2021 13:29:06 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id EB7AD6504B; Mon, 1 Mar 2021 17:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614619119; bh=JvszdDsHQo1uGsbB9x4l0ZwChrFdXWDTd/9GqBxIH84=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kNPzBV513IfqU2JtGxZuTQeAIaM+589JbNs0P2uRVnMBFraQlOYaJ5NpIH13+qAAu HoImaNIuhCD/MgR2FVWeuOy5JGgdT5FAyXMKOlS7vgKqr8n1Ws7Xt9nmdFZ+tQf4gz qE9WOUrpC642bDSHpmYBdBHh+/c74C318UQwwmK4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Parav Pandit , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.10 339/663] IB/mlx5: Return appropriate error code instead of ENOMEM Date: Mon, 1 Mar 2021 17:09:47 +0100 Message-Id: <20210301161158.622605122@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Parav Pandit [ Upstream commit d286ac1d05210695c312b9018b3aa7c2048e9aca ] When mlx5_ib_stage_init_init() fails, return the error code related to failure instead of -ENOMEM. Fixes: 16c1975f1032 ("IB/mlx5: Create profile infrastructure to add and remove stages") Link: https://lore.kernel.org/r/20210127150010.1876121-8-leon@kernel.org Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx5/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index f67165f80ece5..beec0d7c0d6e8 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -3989,8 +3989,7 @@ static int mlx5_ib_stage_init_init(struct mlx5_ib_dev *dev) err_mp: mlx5_ib_cleanup_multiport_master(dev); - - return -ENOMEM; + return err; } static int mlx5_ib_enable_driver(struct ib_device *dev) -- 2.27.0