On 12/13/11 16:03, Jan Beulich wrote: >>>> On 13.12.11 at 15:22, Christoph Egger wrote: >> @@ -335,17 +352,36 @@ static int microcode_resume_match(int cp >> >> if ( src != mc_amd ) >> { >> + xfree(mc_amd->equiv_cpu_table); >> + xfree(mc_amd->mpb); > > mc_amd can be NULL here. > >> xfree(mc_amd); >> - mc_amd = xmalloc_bytes(sizeof(*src) + src->equiv_cpu_table_size); >> + >> + mc_amd = xmalloc_bytes(sizeof(*src)); > > xmalloc(struct microcode_amd) > >> + if ( !mc_amd ) >> + goto err0; > > The error handling is broken here. You need to clear out > uci->mc.mc_amd (i.e. move up the respective assignment). Thanks for review. New version attached. Signed-off-by: Christoph Egger -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85689 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632