--- linux/fs/partitions/efi.c~ 25 Jan 2002 20:15:06 -0000 1.2 +++ linux/fs/partitions/efi.c 14 Feb 2002 16:50:07 -0000 @@ -549,10 +549,14 @@ find_valid_gpt(struct gendisk *hd, struc *gpt = pgpt; *ptes = pptes; - if (agpt) + if (agpt) { kfree(agpt); - if (aptes) + agpt = NULL; + } + if (aptes) { kfree(aptes); + aptes = NULL; + } } /* if primary is valid */ else { /* Primary GPT is bad, check the Alternate GPT */ @@ -602,6 +606,8 @@ find_valid_gpt(struct gendisk *hd, struc /* Both primary and alternate GPTs are bad, and/or PMBR is invalid. * This isn't our disk, return 0. */ + *gpt = *ptes = NULL; + if (pgpt) { kfree(pgpt); pgpt = NULL;