From: Yishai Hadas Date: Sun, 30 Jun 2019 16:23:26 +0000 (+0300) Subject: net/mlx5: Report a CQ error event only when a handler was set X-Git-Tag: v5.3-rc1~79^2~60^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=70a43d3fd4efba2de97152788df723c7812bb834;p=thirdparty%2Flinux.git net/mlx5: Report a CQ error event only when a handler was set Report a CQ error event only when a handler was set. This enables mlx5_ib to not set a handler upon CQ creation and use some other mechanism to get this event as of other events by the mlx5_eq_notifier_register API. Signed-off-by: Yishai Hadas Acked-by: Saeed Mahameed Signed-off-by: Leon Romanovsky --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index c634a78d5cddc..6784545354601 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c @@ -503,7 +503,8 @@ static int cq_err_event_notifier(struct notifier_block *nb, return NOTIFY_OK; } - cq->event(cq, type); + if (cq->event) + cq->event(cq, type); mlx5_cq_put(cq);