* [PATCH] net/mlx5: potential error pointer dereference in error handling
@ 2019-05-03 12:28 Dan Carpenter
2019-05-28 14:38 ` Leon Romanovsky
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-05-03 12:28 UTC (permalink / raw)
To: kernel-janitors
The error handling was a bit flipped around. If the mlx5_create_flow_group()
function failed then it would have resulted in dereferencing "fg" when
it was an error pointer.
Fixes: 80f09dfc237f ("net/mlx5: Eswitch, enable RoCE loopback traffic")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/net/ethernet/mellanox/mlx5/core/rdma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/rdma.c b/drivers/net/ethernet/mellanox/mlx5/core/rdma.c
index 86f77456f873..401441aefbcb 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/rdma.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/rdma.c
@@ -106,10 +106,10 @@ static int mlx5_rdma_enable_roce_steering(struct mlx5_core_dev *dev)
return 0;
-destroy_flow_table:
- mlx5_destroy_flow_table(ft);
destroy_flow_group:
mlx5_destroy_flow_group(fg);
+destroy_flow_table:
+ mlx5_destroy_flow_table(ft);
free:
kvfree(spec);
kvfree(flow_group_in);
--
2.18.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net/mlx5: potential error pointer dereference in error handling
2019-05-03 12:28 [PATCH] net/mlx5: potential error pointer dereference in error handling Dan Carpenter
@ 2019-05-28 14:38 ` Leon Romanovsky
0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2019-05-28 14:38 UTC (permalink / raw)
To: kernel-janitors
On Fri, May 03, 2019 at 03:28:39PM +0300, Dan Carpenter wrote:
> The error handling was a bit flipped around. If the mlx5_create_flow_group()
> function failed then it would have resulted in dereferencing "fg" when
> it was an error pointer.
>
> Fixes: 80f09dfc237f ("net/mlx5: Eswitch, enable RoCE loopback traffic")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/rdma.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Sorry for the delay, applied to mlx5-next branch.
6cc070bdf07c net/mlx5: potential error pointer dereference in error handling
Thanks
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-28 14:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-03 12:28 [PATCH] net/mlx5: potential error pointer dereference in error handling Dan Carpenter
2019-05-28 14:38 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox