]> git.baikalelectronics.ru Git - kernel.git/commit
vfio/ap,ccw: Fix open/close when multiple device FDs are open
authorJason Gunthorpe <jgg@nvidia.com>
Fri, 6 Aug 2021 01:19:08 +0000 (22:19 -0300)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 11 Aug 2021 15:50:11 +0000 (09:50 -0600)
commitdc2f522bd32631704c1f1553b3a3f93de9d3009e
treeec4dc8bb6f52ad6031c5f6a0dc9465a8b6b18acd
parentbed193c63b8e93ff815b80c2d26158183ca69104
vfio/ap,ccw: Fix open/close when multiple device FDs are open

The user can open multiple device FDs if it likes, however these open()
functions call vfio_register_notifier() on some device global
state. Calling vfio_register_notifier() twice in will trigger a WARN_ON
from notifier_chain_register() and the first close will wrongly delete the
notifier and more.

Since these really want the new open/close_device() semantics just change
the functions over.

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/12-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/s390/cio/vfio_ccw_ops.c
drivers/s390/crypto/vfio_ap_ops.c