···237 * fill shadow[] with pages at the right locations, so we only238 * have to fill holes239 */240- memset(shadow, 0, i * sizeof(struct page *));241- for (j = 0, pidx = index; j < i; pidx++, j++)242- shadow[pages[j]->index - pidx] = pages[j];243244 /*245 * now fill in the holes
···237 * fill shadow[] with pages at the right locations, so we only238 * have to fill holes239 */240+ memset(shadow, 0, nr_pages * sizeof(struct page *));241+ for (j = 0; j < i; j++)242+ shadow[pages[j]->index - index] = pages[j];243244 /*245 * now fill in the holes