Commit ad6dc1d
vdpa/mlx5: Avoid processing works if workqueue was destroyed
If mlx5_vdpa gets unloaded while a VM is running, the workqueue will be
destroyed. However, vhost might still have reference to the kick
function and might attempt to push new works. This could lead to null
pointer dereference.
To fix this, set mvdev->wq to NULL just before destroying and verify
that the workqueue is not NULL in mlx5_vdpa_kick_vq before attempting to
push a new work.
Fixes: 5262912 ("vdpa/mlx5: Add support for control VQ and MAC setting")
Signed-off-by: Eli Cohen <elic@nvidia.com>
Link: https://lore.kernel.org/r/20220321141303.9586-1-elic@nvidia.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>1 parent 03a91c9 commit ad6dc1d
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1712 | 1712 | | |
1713 | 1713 | | |
1714 | 1714 | | |
1715 | | - | |
| 1715 | + | |
1716 | 1716 | | |
1717 | 1717 | | |
1718 | 1718 | | |
| |||
2779 | 2779 | | |
2780 | 2780 | | |
2781 | 2781 | | |
| 2782 | + | |
2782 | 2783 | | |
2783 | 2784 | | |
2784 | | - | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
2785 | 2788 | | |
2786 | 2789 | | |
2787 | 2790 | | |
| |||
0 commit comments