]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitd3f1e63cdaaf8cef0a2a0c7a886237d9018b1faf
tree252d086e298f5f219b50026a022ab02681bfcea7
parent82696cb3598d3b891e85a8e29bae603c89b5dc66
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