]> git.baikalelectronics.ru Git - kernel.git/commit
Fix calculation of number of pages in a PRP List
authorNisheeth Bhat <nisheeth.bhat@intel.com>
Thu, 29 Sep 2011 14:10:10 +0000 (10:10 -0400)
committerMatthew Wilcox <matthew.r.wilcox@intel.com>
Fri, 4 Nov 2011 19:53:04 +0000 (15:53 -0400)
commit4403b38c015d60e8126158e6b4b54c093174e390
treec62cff35187c87c8a2b1f6dafdfc577cba94c137
parent55ee66cb9166a69a4d32e0614cf2e538bae06a31
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: Nisheeth Bhat <nisheeth.bhat@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
drivers/block/nvme.c