vfio/ccw: remove WARN_ON during shutdown
authorEric Farman <farman@linux.ibm.com>
Fri, 10 Feb 2023 17:42:27 +0000 (18:42 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 14 Feb 2023 10:45:40 +0000 (11:45 +0100)
commit1c06bb87afb2d95b8e9f4f2e3d0d6772c68f3e76
tree0765f7ba37e7c641b5e5e6a81ec80997ccb4157a
parentadf1e17edc65560ea5615d35ded65834cbf33422
vfio/ccw: remove WARN_ON during shutdown

The logic in vfio_ccw_sch_shutdown() always assumed that the input
subchannel would point to a vfio_ccw_private struct, without checking
that one exists. The blamed commit put in a check for this scenario,
to prevent the possibility of a missing private.

The trouble is that check was put alongside a WARN_ON(), presuming
that such a scenario would be a cause for concern. But this can be
triggered by binding a subchannel to vfio-ccw, and rebooting the
system before starting the mdev (via "mdevctl start" or similar)
or after stopping it. In those cases, shutdown doesn't need to
worry because either the private was never allocated, or it was
cleaned up by vfio_ccw_mdev_remove().

Remove the WARN_ON() piece of this check, since there are plausible
scenarios where private would be NULL in this path.

Fixes: 9e6f07cd1eaa ("vfio/ccw: create a parent struct")
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Link: https://lore.kernel.org/r/20230210174227.2256424-1-farman@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/cio/vfio_ccw_drv.c