We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a111daf commit ef91020Copy full SHA for ef91020
drivers/nvdimm/bus.c
@@ -176,8 +176,8 @@ static int nvdimm_clear_badblocks_region(struct device *dev, void *data)
176
ndr_end = nd_region->ndr_start + nd_region->ndr_size - 1;
177
178
/* make sure we are in the region */
179
- if (ctx->phys < nd_region->ndr_start
180
- || (ctx->phys + ctx->cleared) > ndr_end)
+ if (ctx->phys < nd_region->ndr_start ||
+ (ctx->phys + ctx->cleared - 1) > ndr_end)
181
return 0;
182
183
sector = (ctx->phys - nd_region->ndr_start) / 512;
0 commit comments