diff options
| author | Stephen Rothwell <sfr@canb.auug.org.au> | 2022-06-28 08:56:29 +1000 |
|---|---|---|
| committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2022-06-28 08:56:29 +1000 |
| commit | 85abd4eaa732dff6a87dd7d74841edca76d0d9a4 (patch) | |
| tree | 4e552cd06644fb1793cc66a7247b685bc15c6f95 | |
| parent | 1c2349ae2dd7742812b3961175b3fd65220a8122 (diff) | |
| parent | ef9102004a87cb3f8b26e000a095a261fc0467d3 (diff) | |
| download | linux-next-85abd4eaa732dff6a87dd7d74841edca76d0d9a4.tar.gz | |
Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git
| -rw-r--r-- | drivers/nvdimm/bus.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index a4fc17db707c9..b38d0355b0ac3 100644 --- a/drivers/nvdimm/bus.c +++ b/drivers/nvdimm/bus.c @@ -176,8 +176,8 @@ static int nvdimm_clear_badblocks_region(struct device *dev, void *data) ndr_end = nd_region->ndr_start + nd_region->ndr_size - 1; /* make sure we are in the region */ - if (ctx->phys < nd_region->ndr_start - || (ctx->phys + ctx->cleared) > ndr_end) + if (ctx->phys < nd_region->ndr_start || + (ctx->phys + ctx->cleared - 1) > ndr_end) return 0; sector = (ctx->phys - nd_region->ndr_start) / 512; |
