mic: vop: Fix crash on remove
authorVincent Whitchurch <vincent.whitchurch@axis.com>
Fri, 1 Feb 2019 08:45:09 +0000 (09:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Feb 2019 14:53:54 +0000 (15:53 +0100)
commit4bf13fdbc3567e571c20b415e4df70f564d54067
tree8a624c8605796425923137747e9f1c1d9356fd48
parent70ed7148dadb812f2f7c9927e98ef3cf4869dfa9
mic: vop: Fix crash on remove

The remove path contains a hack which depends on internal structures in
other source files, similar to the one which was recently removed from
the registration path.  Since commit 1ce9e6055fa0 ("virtio_ring:
introduce packed ring support"), this leads to a crash when vop devices
are removed.

The structure in question is only examined to get the virtual address of
the allocated used page.  Store that pointer locally instead to fix the
crash.

Fixes: 1ce9e6055fa0 ("virtio_ring: introduce packed ring support")
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mic/vop/vop_main.c