Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E71DCC433EF for ; Wed, 24 Nov 2021 13:08:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347806AbhKXNL6 (ORCPT ); Wed, 24 Nov 2021 08:11:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:46522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348409AbhKXNJS (ORCPT ); Wed, 24 Nov 2021 08:09:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0A60061A59; Wed, 24 Nov 2021 12:40:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637757631; bh=37TK8niFyefkkf+9qm7JoDzCk8UdohixXVl874uae4w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qlkoOrsgQ8vm+FAWa4gOGw1mMzLDxovwWZPdozUUB6IUBIy5p8MICYz/jZ+WOs4Wo 0N1gTHUt2enNEx6cahAqkRiEsJe8Ioht2SAkvfGDzDCMmlc9XomtVOG8vN7qzh5qyY DLjUph8hg7+O51Znf3FkIIVcEG74JC/0GZ7jtQPU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.19 193/323] RDMA/mlx4: Return missed an error if device doesnt support steering Date: Wed, 24 Nov 2021 12:56:23 +0100 Message-Id: <20211124115725.454468523@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115718.822024889@linuxfoundation.org> References: <20211124115718.822024889@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: Leon Romanovsky [ Upstream commit f4e56ec4452f48b8292dcf0e1c4bdac83506fb8b ] The error flow fixed in this patch is not possible because all kernel users of create QP interface check that device supports steering before set IB_QP_CREATE_NETIF_QP flag. Fixes: c1c98501121e ("IB/mlx4: Add support for steerable IB UD QPs") Link: https://lore.kernel.org/r/91c61f6e60eb0240f8bbc321fda7a1d2986dd03c.1634023677.git.leonro@nvidia.com Reported-by: Dan Carpenter Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx4/qp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index 73bd35d34a257..7209b8a9b0dd2 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c @@ -1057,8 +1057,10 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd, if (dev->steering_support == MLX4_STEERING_MODE_DEVICE_MANAGED) qp->flags |= MLX4_IB_QP_NETIF; - else + else { + err = -EINVAL; goto err; + } } err = set_kernel_sq_size(dev, &init_attr->cap, qp_type, qp); -- 2.33.0