Skip to content

Commit

Permalink
net/mlx5_core: Avoid copying outbox in aysnc command completion
Browse files Browse the repository at this point in the history
Avoid copying to the output buffer in cmd_exec since this is done after the
command is completed. Failure to do this may cause cases where the callback
handler is called before the copy done by cmd_exec which then overwrites it.

Reported-by: Tamer Hleihel <[email protected]>
Signed-off-by: Eli Cohen <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eli Cohen authored and davem330 committed Apr 2, 2015
1 parent 64599cc commit 05e4ecd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,8 @@ static int cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out,
goto out_out;
}

err = mlx5_copy_from_msg(out, outb, out_size);
if (!callback)
err = mlx5_copy_from_msg(out, outb, out_size);

out_out:
if (!callback)
Expand Down

0 comments on commit 05e4ecd

Please sign in to comment.