summaryrefslogtreecommitdiffstats
path: root/sys/dev/mlx5
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2016-11-15 08:50:42 +0000
committerhselasky <hselasky@FreeBSD.org>2016-11-15 08:50:42 +0000
commit5730ca3c80055f9dd7f86a7d971c22fed8820c14 (patch)
treeb5c052e49d878416dca4b5c50d8e17b9a5b9142e /sys/dev/mlx5
parent826065e0b8300b16815b52bb3b66e49a59d9db3e (diff)
downloadFreeBSD-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.c5
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) {
OpenPOWER on IntegriCloud