diff options
author | Eric Farman <farman@linux.ibm.com> | 2018-10-02 03:02:35 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-10-18 09:16:23 +0200 |
commit | 8d2f62cb2d463456a4dbc84c59d1d2a05947fe20 (patch) | |
tree | 1c5f00af6e079a70d594207eca07296466aa34f2 | |
parent | e3f725f5c46aa7e989430b0ecc3463a5c4e4cd49 (diff) | |
download | linux-rpi3-8d2f62cb2d463456a4dbc84c59d1d2a05947fe20.tar.gz linux-rpi3-8d2f62cb2d463456a4dbc84c59d1d2a05947fe20.tar.bz2 linux-rpi3-8d2f62cb2d463456a4dbc84c59d1d2a05947fe20.zip |
s390/cio: Fix how vfio-ccw checks pinned pages
commit 24abf2901b18bf941b9f21ea2ce5791f61097ae4 upstream.
We have two nested loops to check the entries within the pfn_array_table
arrays. But we mistakenly use the outer array as an index in our check,
and completely ignore the indexing performed by the inner loop.
Cc: stable@vger.kernel.org
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Message-Id: <20181002010235.42483-1-farman@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/s390/cio/vfio_ccw_cp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c index 72ce6ad95767..1419eaea03d8 100644 --- a/drivers/s390/cio/vfio_ccw_cp.c +++ b/drivers/s390/cio/vfio_ccw_cp.c @@ -172,7 +172,7 @@ static bool pfn_array_table_iova_pinned(struct pfn_array_table *pat, for (i = 0; i < pat->pat_nr; i++, pa++) for (j = 0; j < pa->pa_nr; j++) - if (pa->pa_iova_pfn[i] == iova_pfn) + if (pa->pa_iova_pfn[j] == iova_pfn) return true; return false; |