Skip to content

Commit f3e3a40

Browse files
Jason J. HerneAlexander Gordeev
authored andcommitted
s390/vfio-ap: Ignore duplicate link requests in vfio_ap_mdev_link_queue
vfio_ap_mdev_link_queue is changed to detect if a matrix_mdev has already linked the given queue. If so, it bails out. Signed-off-by: "Jason J. Herne" <jjherne@linux.ibm.com> Reviewed-by: Tony Krowiak <akrowiak@linux.ibm.com> Link: https://lore.kernel.org/r/20240415152555.13152-4-jjherne@linux.ibm.com Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
1 parent e12aa0b commit f3e3a40

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/s390/crypto/vfio_ap_ops.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -794,10 +794,11 @@ static int vfio_ap_mdev_probe(struct mdev_device *mdev)
794794
static void vfio_ap_mdev_link_queue(struct ap_matrix_mdev *matrix_mdev,
795795
struct vfio_ap_queue *q)
796796
{
797-
if (q) {
798-
q->matrix_mdev = matrix_mdev;
799-
hash_add(matrix_mdev->qtable.queues, &q->mdev_qnode, q->apqn);
800-
}
797+
if (!q || vfio_ap_mdev_get_queue(matrix_mdev, q->apqn))
798+
return;
799+
800+
q->matrix_mdev = matrix_mdev;
801+
hash_add(matrix_mdev->qtable.queues, &q->mdev_qnode, q->apqn);
801802
}
802803

803804
static void vfio_ap_mdev_link_apqn(struct ap_matrix_mdev *matrix_mdev, int apqn)

0 commit comments

Comments
 (0)