]> git.baikalelectronics.ru Git - kernel.git/commit
nvdimm: Fix badblocks clear off-by-one error
authorChris Ye <chris.ye@intel.com>
Wed, 1 Jun 2022 00:09:54 +0000 (17:09 -0700)
committerDan Williams <dan.j.williams@intel.com>
Fri, 24 Jun 2022 18:57:19 +0000 (11:57 -0700)
commit824b8b638bf0b8ff15d91e025d8b037d1bb7eb26
tree48ed6a2026e49edcda4ae2ec06a5ca962eaa2d08
parent08aafa0d475a08e31a13403e9df41c7179f4bdcd
nvdimm: Fix badblocks clear off-by-one error

nvdimm_clear_badblocks_region() validates badblock clearing requests
against the span of the region, however it compares the inclusive
badblock request range to the exclusive region range. Fix up the
off-by-one error.

Fixes: e251ee5093c1 ("libnvdimm: rework region badblocks clearing")
Cc: <stable@vger.kernel.org>
Signed-off-by: Chris Ye <chris.ye@intel.com>
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
Link: https://lore.kernel.org/r/165404219489.2445897.9792886413715690399.stgit@dwillia2-xfh
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/bus.c