]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit5681e71ad278e92b812ae19558989c05503aca48
treeff3374592eceeb202d49f563837da9a0e107c2c5
parentcdd7c910b2191664bf178211464314c5acacea88
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