diff options
author | hselasky <hselasky@FreeBSD.org> | 2016-11-15 08:56:18 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2016-11-15 08:56:18 +0000 |
commit | 039b649589bd4d0bcd49d6a10a434663e780489f (patch) | |
tree | 03b1190c437f737ea260630889131accba36f3da | |
parent | 49181e1abede499653ff4472f70eea32e0356861 (diff) | |
download | FreeBSD-src-039b649589bd4d0bcd49d6a10a434663e780489f.zip FreeBSD-src-039b649589bd4d0bcd49d6a10a434663e780489f.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
-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) { |