Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3125614rwb; Mon, 15 Aug 2022 18:46:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR6iXoTw2PZXW7ojREfcqAsxtLCGHX0l8OifXPlHrcvZ8MSOWKRAFmZRdDRehtAdcOUbUEsk X-Received: by 2002:a17:902:f604:b0:172:75a4:33ea with SMTP id n4-20020a170902f60400b0017275a433eamr4164579plg.7.1660614363838; Mon, 15 Aug 2022 18:46:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660614363; cv=none; d=google.com; s=arc-20160816; b=QXLdn/IYbKs5Kfu3R271Y4zoOxN4IMTbERAe6BZuoajv5uI86X71XF9yi1tvVkuwL4 xMPbsFnhIeJ+kvmscuzEIPoxgStTWbH0ZXSzN0XJKGG42JMh231IRuTPHHTuTeVmHz4N hGerHuu7gN5O4k1YefViC5whsQPawHadWNbGjcHnP9jGsnewobZZalkJMJisRAKucuPX W5sUxPFaM9mQzVEEZjwqJ+tMTJe60yxQtUjp9FuB6bzSHRHnD16DgZg7NrEcOJ6SQHx3 tkuvv6IM5JtPfoimBRsGpmIYSbYJpeJq/jjChjFSM+b4yOpfGWsp+g4N0cVOAlhAkfSp rBiA== 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=apde/enR56SWApNEOzOer95dlQUdnAS6q07v+Ood2WM=; b=YEjPirNjEAMbRWVvCNgcZtYilPax2t0zhos0KSzMwduLzmQDJulq3hkfNAy7Rnokkd pKCbQWPf26Ae+PK5IluUpNWCyKDgzfFLMJ/t6gC6pswZKLO1Qed6SV1NLzFHXh8nzA82 egzQQfvx5/yh895Kau+4QbU2Y0MDcAX4yVXn8/Q5722VDmuTGQZkwxdtNRqQmAiReZUC Zpj26qd8vaBaW4b1LeJJHEB3ojQK6XjnBrby/mVIqgzjz5MtR1U+vGE9pH4Mwt0pGwCC WLVCLPBO1H9Q0TVDdVxMbFUTOPOUKBUE2N9n1XXgeE3ajTN8Eh7gwm4lGhVDFm2+NQRb BURg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="DF3/kYDG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g67-20020a636b46000000b0041cea4daf7dsi12012365pgc.774.2022.08.15.18.45.51; Mon, 15 Aug 2022 18:46:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="DF3/kYDG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1347517AbiHPAfB (ORCPT + 99 others); Mon, 15 Aug 2022 20:35:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354276AbiHPAbf (ORCPT ); Mon, 15 Aug 2022 20:31:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B1FC1863CC; Mon, 15 Aug 2022 13:36:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A427C611E2; Mon, 15 Aug 2022 20:36:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26941C433C1; Mon, 15 Aug 2022 20:36:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595782; bh=i+usJMXzcolzFskcxzkuh3NOCeVE3/JMKNvGxJ33YvU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DF3/kYDGBRIp5Ma5wZQMSRMb2fau8DhCXNS4RMqK0D6yKyVfsWiPs+MU5WBYOpmgS wLJtqEdDJ3gmq16YpvTi+G5Mx4heIeDN4SHrpNAJc28GM8Cte+EceyGhQvuqxORO5C 3vpJ0PV+ywGhQLlO1X9Il9e2re38WB0A5V6/Q8r4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Itay Aveksis , Maor Gottlieb , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.19 0874/1157] RDMA/mlx5: Add missing check for return value in get namespace flow Date: Mon, 15 Aug 2022 20:03:50 +0200 Message-Id: <20220815180514.427123341@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maor Gottlieb [ Upstream commit c9776457bd5eaad4ce4ecb17af8d8f3cc6957c0b ] Add missing check for return value when calling to mlx5_ib_ft_type_to_namespace, even though it can't really fail in this specific call. Fixes: 52438be44112 ("RDMA/mlx5: Allow inserting a steering rule to the FDB") Link: https://lore.kernel.org/r/7b9ceda217d9368a51dc47a46b769bad4af9ac92.1659256069.git.leonro@nvidia.com Reviewed-by: Itay Aveksis Signed-off-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx5/fs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/fs.c b/drivers/infiniband/hw/mlx5/fs.c index 39ffb363ba0c..531aa35ba67c 100644 --- a/drivers/infiniband/hw/mlx5/fs.c +++ b/drivers/infiniband/hw/mlx5/fs.c @@ -2050,12 +2050,10 @@ static int mlx5_ib_matcher_ns(struct uverbs_attr_bundle *attrs, if (err) return err; - if (flags) { - mlx5_ib_ft_type_to_namespace( + if (flags) + return mlx5_ib_ft_type_to_namespace( MLX5_IB_UAPI_FLOW_TABLE_TYPE_NIC_TX, &obj->ns_type); - return 0; - } } obj->ns_type = MLX5_FLOW_NAMESPACE_BYPASS; -- 2.35.1