Skip to content
Commit 0d1bc912 authored by Nisheeth Bhat's avatar Nisheeth Bhat Committed by Matthew Wilcox
Browse files

Fix calculation of number of pages in a PRP List



The existing calculation underestimated the number of pages required
as it did not take into account the pointer at the end of each page.
The replacement calculation may overestimate the number of pages required
if the last page in the PRP List is entirely full.  By using ->npages
as a counter as we fill in the pages, we ensure that we don't try to
free a page that was never allocated.

Signed-off-by: default avatarNisheeth Bhat <nisheeth.bhat@intel.com>
Signed-off-by: default avatarMatthew Wilcox <matthew.r.wilcox@intel.com>
parent bc5fc7e4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment