xen/gntdev: Check and release imported dma-bufs on close
authorOleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Thu, 14 Feb 2019 14:23:21 +0000 (16:23 +0200)
committerJuergen Gross <jgross@suse.com>
Mon, 18 Feb 2019 05:50:10 +0000 (06:50 +0100)
commit068e79f4a9d613f4327cb4062a1e49c0eaca7149
tree8c58b3e65adf69dbf417218000fd3d71d46bf528
parentfa13e665e02874c0a5f4d06d6967ae34a6cb3d6a
xen/gntdev: Check and release imported dma-bufs on close

Check if there are any imported dma-bufs left not released by
user-space when grant device's release callback is called and
free those if this is the case. This can happen if user-space
leaks the buffers because of a bug or application has been
terminated for any reason.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Reviewed-by: Boris Ostrovsky@oracle.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/xen/gntdev-dmabuf.c