Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3010766rwb; Mon, 15 Aug 2022 16:06:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR6C5n/IyL9YT16UfLt4wpmLDmr2jOTWEmcNn3qmWNKOKWUnEFn09r1xyyONoocmx/1tBlfu X-Received: by 2002:a05:6402:254b:b0:43e:910f:caea with SMTP id l11-20020a056402254b00b0043e910fcaeamr16642531edb.423.1660604767887; Mon, 15 Aug 2022 16:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660604767; cv=none; d=google.com; s=arc-20160816; b=dqaJhrnU3cObkI/ukS2AqkMuqRadrggHhRQCiyw2ISFRL++eDERLStSWF+YkShWdL8 eHlbSfM2+MLsivsBUB+wKDv/NkyhbVuQwh7y5DEQxFTJjgG1f4E0fwzahPdKyetv7q9g ivkR+DpwQtQL5uR3XqHXtzNWdoA7/X4crcRVZuiyl+Q+VlVHhnQRNF4ILe9P7EwKzCoC F2ONm5t3XRYz2t+Wep31Hpoxowuy8yItgAwKpvPliSpkuhsRogeDXcrBNPQ57gsnTYBc hyujjvJKXS+W/b2VJ0XT4pK0dW+mQnljCzroVMTru4bDycQEU36L+wT4niu2wiHIO+VP jHIA== 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=abINWTV2iCgN6l1qpTUTS4K9QBYeVKef6Js2LP+K5w8=; b=04dO2/G8Mkek9VEBENRlJdB9sllxaNY7hXW3cUMpR2upPeslOGk6NlihT7pLFAWUE9 2mjZ/aJzM6pzjFlIp6+j64ST1uureTPqT8wkZdqN08oIU0tun4W3eeAbeLmz27LbUHzq +cpemF7t1aGb+lzsJZZbHiNGXTRzhVtMzSxvg1/yh2OH8A9cnCwt3MtM1ufKUvZMDqHS R4Io9EtNo9eo5bKD+2KilFuGpyt43RNaaFY6duh+4lBUZl7KRjt9tiUbVVETKH0QBALt 30USyGnToG/01sdZob8jL0S7wWu9CoXSnTdB7F9YLkUSp09PY3zQv7fbJrw3DyXeFacm HSoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MRv+ou73; 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 du22-20020a17090772d600b0072b749835e9si8675732ejc.850.2022.08.15.16.05.41; Mon, 15 Aug 2022 16:06:07 -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=MRv+ou73; 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 S1350751AbiHOW1K (ORCPT + 99 others); Mon, 15 Aug 2022 18:27:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347284AbiHOWTX (ORCPT ); Mon, 15 Aug 2022 18:19:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE6036AA30; Mon, 15 Aug 2022 12:43:18 -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 D6287B80EAB; Mon, 15 Aug 2022 19:43:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27582C433C1; Mon, 15 Aug 2022 19:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592595; bh=+mp64Pr/EQHtTObpXJCI/YKDDO+OrIRtCHdSi07jgfw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MRv+ou73clbv2kF5coHX0LeUUSbnDsfgrpoGx/Vbxc5S/abIx/cohGbZz2kQAsW91 1/YmKkzGIg4s6o3tzKMDcQ2aFQRrMCkXesz1Vz94q88CP/plmoxP6hFn/bgEab0P2W RUQ3jjHKrN6dhIA4pPhWCzd15mcXRW9XVeO+Zbvo= 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.18 0813/1095] RDMA/mlx5: Add missing check for return value in get namespace flow Date: Mon, 15 Aug 2022 20:03:32 +0200 Message-Id: <20220815180502.902176457@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 661ed2b44508..6092118de672 100644 --- a/drivers/infiniband/hw/mlx5/fs.c +++ b/drivers/infiniband/hw/mlx5/fs.c @@ -2265,12 +2265,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