Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1865256rwb; Fri, 19 Aug 2022 10:40:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR7yqBc7xFcE2lsWC+CCPYR1q7vLHCRZHFWz9gwndDmeyTI9+ownEfpcKQPGrEhwKljahmek X-Received: by 2002:a17:90a:be01:b0:1fa:9fe7:d5a6 with SMTP id a1-20020a17090abe0100b001fa9fe7d5a6mr9457541pjs.139.1660930820897; Fri, 19 Aug 2022 10:40:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930820; cv=none; d=google.com; s=arc-20160816; b=MHjtbXmOoRJP8SlN01ubCCJ7xyahZgi733DSdxksZIhHGQMSUpE8w9oi5sj2fF/nrY n0CjA8zD32Dqh4iXnzCTlxfwzmJY/JCHO65tNxAkPewkUM9hoMOOgySCPAkbF7LQUSSq 2wLIRyEvTuqWBrIdnVX16usR95TX5D9hVutH3qHEPQ53AWZyQR1NXSwZTPfEVJH39i1t 7Ar8utVvID3siHYFVrtNqKOmKH+/ZXtTVmB9tbCjY/JgKy+4Z4Iz1N5JJH+rwAf6IXEy 7F83wZRQCKdGmyQFkLqDrQET9FbEhMooJmW/r5FqouYq6M50JrkrX/ev9w4foRLEZjX0 ZRTQ== 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=lbCOz5RJqwKMFxrJv1JapCgPwpbCDDddhdf01Dn+gXc=; b=pESe73qJaNtL5/1b56ebAO1zj72pHrpsgb1vNRRMpxcsXvxFITKF9LJDwD8QzRZ2fL 2RvzsAFgXdIHRMR8MjE2FY21wA01Vv4DFEdYZ5vcoX/cvbT38CwHDcuSav4Usr+0bPGs 1QNPo5zcBUxJxqey7d960Fw2tS2fRYXsDxb1XjrYwNfl8giEHOuua+75g8f19rfXw/YQ i3iYhaFkNldRxwCVKErDM/cN3ZhzbbPR60brHx/K32FdtWqzBHJXBbxrA28PwWKhemfM Jiu4P1as3E9bfv4rS2aj0g6RMhn1aCIL0mDKsYTyKNbTiYZz4iI5xZGbuDwcUznFqlVp F9oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w4aEHsZk; 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 j9-20020a056a00130900b00535bfefd390si4954296pfu.303.2022.08.19.10.40.10; Fri, 19 Aug 2022 10:40:20 -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=w4aEHsZk; 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 S1352889AbiHSQ2y (ORCPT + 99 others); Fri, 19 Aug 2022 12:28:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353008AbiHSQ0A (ORCPT ); Fri, 19 Aug 2022 12:26:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38A20F14D6; Fri, 19 Aug 2022 09:03:45 -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 8F134612DF; Fri, 19 Aug 2022 16:03:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C282C433D7; Fri, 19 Aug 2022 16:03:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660925011; bh=fafzBX3pbMLUlCle5R2Fa+/PttDn+jS3CmHEktaG9G4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w4aEHsZklvg4dGXTMOgEoO3a2Ndy7xwrjQTlipwHMq/RuGAoN4RMTcyeo28+LhKZ+ DCiGKkDyfcJG29L6hcDOh82Fh5AX/gCI4Bt0f5iT2cRU0nRwnzv4/jkm/ygB7KIQcf ZbXS7ysP3nB3EQgQ+NBBXolLuzoAj5lYtpM2VRmE= 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.10 355/545] RDMA/mlx5: Add missing check for return value in get namespace flow Date: Fri, 19 Aug 2022 17:42:05 +0200 Message-Id: <20220819153845.279115503@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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 b3391ecedda7..0404e6f22d37 100644 --- a/drivers/infiniband/hw/mlx5/fs.c +++ b/drivers/infiniband/hw/mlx5/fs.c @@ -2081,12 +2081,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