diff options
| author | Ariel Ehrenberg <aehrenberg@nvidia.com> | 2026-06-15 08:16:17 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2026-07-07 11:25:41 +0000 |
| commit | 284e06dec78ffbbf8919dc0aa11073ecabba7176 (patch) | |
| tree | 47ce71a617dedcfc5001098d3964e74d716e6542 | |
| parent | 0e9bbbdcbea8edc6ad259a9428234b494014bc4e (diff) | |
mlx5: guard against a NULL CQ event handler in mlx5_cq_event()
DEVX and mlx5en created CQs are registered without an asynchronous
event handler (mcq.event is NULL). An asynchronous CQ_ERROR event for
such a CQ made mlx5_cq_event() call through a NULL pointer and panic.
Reviewed by: kib
Tested by: Wafa Hamzah <wafah@nvidia.com>
Sponsored by: Nvidia networking
MFC after: 1 month
| -rw-r--r-- | sys/dev/mlx5/mlx5_core/mlx5_cq.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/mlx5/mlx5_core/mlx5_cq.c b/sys/dev/mlx5/mlx5_core/mlx5_cq.c index fa28ae6dece9..f1f8fc03de6c 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_cq.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_cq.c @@ -113,7 +113,8 @@ void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type) spin_unlock(&table->writerlock); if (likely(cq != NULL)) { - cq->event(cq, event_type); + if (cq->event) + cq->event(cq, event_type); } else { mlx5_core_warn(dev, "Asynchronous event for bogus CQ 0x%x\n", cqn); |
