]> git.baikalelectronics.ru Git - kernel.git/commitdiff
RDMA/mlx5: Add missing check for return value in get namespace flow
authorMaor Gottlieb <maorg@nvidia.com>
Sun, 31 Jul 2022 08:29:08 +0000 (11:29 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:59 +0000 (14:23 +0200)
[ Upstream commit 3a2a4536bfddb0888a6739ef7327eca8f1ee53b8 ]

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: 05bfa671a490 ("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 <itayav@nvidia.com>
Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/mlx5/fs.c

index 5fbc0a8454b9142e1d2aa8e7449f4e870ba2b378..8a7e182af5303e6e1d08eb6864cd3a5255eb7c90 100644 (file)
@@ -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;