diff options
author | hselasky <hselasky@FreeBSD.org> | 2016-11-15 08:50:42 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2016-11-15 08:50:42 +0000 |
commit | 5730ca3c80055f9dd7f86a7d971c22fed8820c14 (patch) | |
tree | b5c052e49d878416dca4b5c50d8e17b9a5b9142e /sys/dev/mlx5 | |
parent | 826065e0b8300b16815b52bb3b66e49a59d9db3e (diff) | |
download | FreeBSD-src-5730ca3c80055f9dd7f86a7d971c22fed8820c14.zip FreeBSD-src-5730ca3c80055f9dd7f86a7d971c22fed8820c14.tar.gz |
MFC r308409:
When a firmware command times out do not free the command structure to
avoid use after free.
Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/dev/mlx5')
-rw-r--r-- | sys/dev/mlx5/mlx5_core/mlx5_cmd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/mlx5/mlx5_core/mlx5_cmd.c b/sys/dev/mlx5/mlx5_core/mlx5_cmd.c index 2551d3e..6d6e036 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_cmd.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_cmd.c @@ -1245,8 +1245,11 @@ static int cmd_exec_helper(struct mlx5_core_dev *dev, void *in, int in_size, voi err = mlx5_cmd_invoke(dev, inb, outb, out, out_size, callback, context, pages_queue, &status); - if (err) + if (err) { + if (err == -ETIMEDOUT) + return err; goto out_out; + } mlx5_core_dbg(dev, "err %d, status %d\n", err, status); if (status) { |