···237237 * fill shadow[] with pages at the right locations, so we only238238 * have to fill holes239239 */240240- memset(shadow, 0, i * sizeof(struct page *));241241- for (j = 0, pidx = index; j < i; pidx++, j++)242242- shadow[pages[j]->index - pidx] = pages[j];240240+ memset(shadow, 0, nr_pages * sizeof(struct page *));241241+ for (j = 0; j < i; j++)242242+ shadow[pages[j]->index - index] = pages[j];243243244244 /*245245 * now fill in the holes