summaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio
diff options
context:
space:
mode:
authorEric Farman <farman@linux.ibm.com>2019-05-15 01:42:45 +0200
committerCornelia Huck <cohuck@redhat.com>2019-06-03 12:02:55 +0200
commitc34a12e6a3df3aae8cb6f47baf0d14ef0fbecf7f (patch)
tree1424092e049f011634f907165cecd68c8ab4c07e /drivers/s390/cio
parente4f3f18b12324e2c140b97f93e3259eee9696d11 (diff)
downloadlinux-c34a12e6a3df3aae8cb6f47baf0d14ef0fbecf7f.tar.gz
linux-c34a12e6a3df3aae8cb6f47baf0d14ef0fbecf7f.tar.bz2
linux-c34a12e6a3df3aae8cb6f47baf0d14ef0fbecf7f.zip
s390/cio: Initialize the host addresses in pfn_array
Let's initialize the host address to something that is invalid, rather than letting it default to zero. This just makes it easier to notice when a pin operation has failed or been skipped. Signed-off-by: Eric Farman <farman@linux.ibm.com> Message-Id: <20190514234248.36203-5-farman@linux.ibm.com> Reviewed-by: Farhan Ali <alifm@linux.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r--drivers/s390/cio/vfio_ccw_cp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c
index e33265fb80b0..086faf2dacd3 100644
--- a/drivers/s390/cio/vfio_ccw_cp.c
+++ b/drivers/s390/cio/vfio_ccw_cp.c
@@ -91,8 +91,11 @@ static int pfn_array_alloc(struct pfn_array *pa, u64 iova, unsigned int len)
pa->pa_pfn = pa->pa_iova_pfn + pa->pa_nr;
pa->pa_iova_pfn[0] = pa->pa_iova >> PAGE_SHIFT;
- for (i = 1; i < pa->pa_nr; i++)
+ pa->pa_pfn[0] = -1ULL;
+ for (i = 1; i < pa->pa_nr; i++) {
pa->pa_iova_pfn[i] = pa->pa_iova_pfn[i - 1] + 1;
+ pa->pa_pfn[i] = -1ULL;
+ }
return 0;
}