vfio-ccw: make it safe to access channel programs
authorCornelia Huck <cohuck@redhat.com>
Mon, 21 Jan 2019 08:55:18 +0000 (09:55 +0100)
committerCornelia Huck <cohuck@redhat.com>
Wed, 24 Apr 2019 12:18:51 +0000 (14:18 +0200)
commit71189f263f8a3db7b72ca75be14e7309375e8707
tree252d086e298f5f219b50026a022ab02681bfcea7
parent1c410fd6a561af452aba282b1cd3cabef2080d72
vfio-ccw: make it safe to access channel programs

When we get a solicited interrupt, the start function may have
been cleared by a csch, but we still have a channel program
structure allocated. Make it safe to call the cp accessors in
any case, so we can call them unconditionally.

While at it, also make sure that functions called from other parts
of the code return gracefully if the channel program structure
has not been initialized (even though that is a bug in the caller).

Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
drivers/s390/cio/vfio_ccw_cp.c
drivers/s390/cio/vfio_ccw_cp.h
drivers/s390/cio/vfio_ccw_fsm.c