Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2883113rwb; Mon, 15 Aug 2022 13:15:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR52KqaXfNTL+DV3VZ17rwXs8BjtaSoeSvv2pD7lA4oEw5VyYB9ua6JBZ5C3CHlvTsZNtrWJ X-Received: by 2002:a05:6402:3220:b0:43d:ca4f:d2b9 with SMTP id g32-20020a056402322000b0043dca4fd2b9mr15852191eda.177.1660594517612; Mon, 15 Aug 2022 13:15:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594517; cv=none; d=google.com; s=arc-20160816; b=XJ202ZsXy97JQp7aoG52FjNP9438dxjQJrcNQnO7m6Vg0yuk0xcajy/534/ie+AMe7 iCCqK1DAad/HUD5z0zmqrKBFQ90R0qGdXrfm06t6/UZvnjYOFRBcLxmXR5w8ZshcRehh tl/6+hkK19BmFN6c6IdkG6TVcUguYbzY4yobZLznlMzpzxHY1KKTIAk4hwvqXT8c9q2H 9dt1IqBF0H7vcC1+9au7WzmwtFtaIpTvr8V5eFjHhOziGiu00MV6cQN+hY7Zf7sql+RD AW6LuAIBoEd2OCMQZIzrvuuLFpHM2VEfrVYo05VszBcwp9Z+pkgrNoM4Noml1iCkvqoy e77g== 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=mnFpz/a6OVAP3afQdsOvw9mjnJDmUqccOJ3YRzPm0xc=; b=cNmv7RLNVUNCbaPW9ZKoahyNjiIseb4LVViX7KXUwtMCOixvWFNv8mUXP8NX0KjEUE DUfOzFXB7I3sw/YF7JnA/sWmoEiw8MQUM+nqRtTbDJwK+4KgGmKERYNbECdr7zhCSR45 xRqFBMCR2dl1N/8lxQb09HNT77fbE2aEMfwAMa61UzjjDEWbLZma9xT2QiSm7EZb1gSk 9CS2Q0kYlm4bUPUhq4XLhSC1HWFST1iL+ttnFI41+QQr8U/Xyvs5kOHzGuOE+1lNPGVz VYQklxVhINhV8ag1tMOVTxRF/e1w7m0T/ly5Wsd++b+LQOWUppd07GuP50mWh7Jxm7CY 9hHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I62mynV8; 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 dr22-20020a170907721600b0072a6d845d96si8080996ejc.8.2022.08.15.13.14.50; Mon, 15 Aug 2022 13:15:17 -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=I62mynV8; 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 S245647AbiHOT3J (ORCPT + 99 others); Mon, 15 Aug 2022 15:29:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245400AbiHOTZ6 (ORCPT ); Mon, 15 Aug 2022 15:25:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3EEE5A2F5; Mon, 15 Aug 2022 11:41:20 -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 ams.source.kernel.org (Postfix) with ESMTPS id 683E7B8105C; Mon, 15 Aug 2022 18:41:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B053C433D6; Mon, 15 Aug 2022 18:41:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588878; bh=uSXCGKyWfEZEfMx7t2fOTKn70UCFSbJkruLUw78RvUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I62mynV8yP5AtXABpqGDTeSoPBtDXXG9uKr9Cgy7dDlKvr4kwyiog0MXzp205EcMd NiAxQ9sKSWLyt+gctFB+iLyiBspmX7PWRzAf3k8EnXC8kNNH5fkvffoSA3JmSILxM1 1lRc5QHgBaernsQAgbdZp4FZnhF+U30sl1Jwq3DE= 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.15 543/779] RDMA/mlx5: Add missing check for return value in get namespace flow Date: Mon, 15 Aug 2022 20:03:07 +0200 Message-Id: <20220815180400.514895853@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 5fbc0a8454b9..8a7e182af530 100644 --- a/drivers/infiniband/hw/mlx5/fs.c +++ b/drivers/infiniband/hw/mlx5/fs.c @@ -2078,12 +2078,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