The function handles one page in one time, allocating umc.retire_unit
bad page records is enough.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
struct ta_ras_query_address_output addr_out;
struct ras_err_data err_data;
- err_data.err_addr =
- kcalloc(adev->umc.max_ras_err_cnt_per_query,
+ err_data.err_addr = kcalloc(adev->umc.retire_unit,
sizeof(struct eeprom_table_record), GFP_KERNEL);
if (!err_data.err_addr) {
dev_warn(adev->dev, "Failed to alloc memory in bad page lookup!\n");
else
goto out;
- for (i = 0; i < adev->umc.max_ras_err_cnt_per_query; i++) {
+ for (i = 0; i < adev->umc.retire_unit; i++) {
if (pos >= len)
goto out;