OSDN Git Service

net/mlx5e: Return the allocated flow directly from __mlx5e_add_fdb_flow
authorJason Gunthorpe <jgg@mellanox.com>
Sun, 20 Jan 2019 08:30:25 +0000 (10:30 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 25 Jan 2019 20:16:14 +0000 (12:16 -0800)
commit71129676ab59dc63ba9e48a09a3386242a516751
treeff3374592eceeb202d49f563837da9a0e107c2c5
parent149e566fef8120a00c49f24e8f570186200e1e81
net/mlx5e: Return the allocated flow directly from __mlx5e_add_fdb_flow

This confusing construction confuses the compiler which can't see
that flow is initialized if !err:

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c: In function `mlx5e_configure_flower`
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:2727:28: warning:
`flow` may be used uninitialized in this function
[-Wmaybe-uninitialized]

There is no reason for two function outputs, just return the
pointer directly and use ERR_PTR to encode a failure.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c