···120 if (is_pdc_pat()) {121 ulong status;122 unsigned long bytecnt;123- pdc_pat_cell_mod_maddr_block_t pa_pdc_cell;124#undef USE_PAT_CPUID125#ifdef USE_PAT_CPUID126 struct pdc_pat_cpu_num cpu_info;127#endif1280000129 status = pdc_pat_cell_module(&bytecnt, dev->pcell_loc,130- dev->mod_index, PA_VIEW, &pa_pdc_cell);131132 BUG_ON(PDC_OK != status);133134 /* verify it's the same as what do_pat_inventory() found */135- BUG_ON(dev->mod_info != pa_pdc_cell.mod_info);136- BUG_ON(dev->pmod_loc != pa_pdc_cell.mod_location);137138- txn_addr = pa_pdc_cell.mod[0]; /* id_eid for IO sapic */00139140#ifdef USE_PAT_CPUID141/* We need contiguous numbers for cpuid. Firmware's notion
···120 if (is_pdc_pat()) {121 ulong status;122 unsigned long bytecnt;123+ pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell;124#undef USE_PAT_CPUID125#ifdef USE_PAT_CPUID126 struct pdc_pat_cpu_num cpu_info;127#endif128129+ pa_pdc_cell = kmalloc(sizeof (*pa_pdc_cell), GFP_KERNEL);130+ if (!pa_pdc_cell)131+ panic("couldn't allocate memory for PDC_PAT_CELL!");132+133 status = pdc_pat_cell_module(&bytecnt, dev->pcell_loc,134+ dev->mod_index, PA_VIEW, pa_pdc_cell);135136 BUG_ON(PDC_OK != status);137138 /* verify it's the same as what do_pat_inventory() found */139+ BUG_ON(dev->mod_info != pa_pdc_cell->mod_info);140+ BUG_ON(dev->pmod_loc != pa_pdc_cell->mod_location);141142+ txn_addr = pa_pdc_cell->mod[0]; /* id_eid for IO sapic */143+144+ kfree(pa_pdc_cell);145146#ifdef USE_PAT_CPUID147/* We need contiguous numbers for cpuid. Firmware's notion