vfio-ccw: Set pa_nr to 0 if memory allocation fails for pa_iova_pfn
authorFarhan Ali <alifm@linux.ibm.com>
Thu, 11 Jul 2019 14:28:53 +0000 (10:28 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Aug 2019 08:12:43 +0000 (10:12 +0200)
commit6f9dff8d1d581e776caeb4dae65453bda2eb9d92
tree6468009c245ff7077321ad9872a9d6a69dc16fdf
parentbb312b4aa8b080b24a6ae190170d23304f6d0f56
vfio-ccw: Set pa_nr to 0 if memory allocation fails for pa_iova_pfn

[ Upstream commit c1ab69268d124ebdbb3864580808188ccd3ea355 ]

So we don't call try to call vfio_unpin_pages() incorrectly.

Fixes: 0a19e61e6d4c ("vfio: ccw: introduce channel program interfaces")
Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <33a89467ad6369196ae6edf820cbcb1e2d8d050c.1562854091.git.alifm@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/s390/cio/vfio_ccw_cp.c