mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-01 12:19:28 +00:00
Don't attempt to free the GPT partition list for a disk with an empty GPT.
Submitted by: Yuri Pankov yuri.pankov of gmail MFC after: 3 days
This commit is contained in:
parent
ce2b1ae5c4
commit
2a4eff4703
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=193719
@ -990,7 +990,8 @@ bd_open_gpt(struct open_disk *od, struct i386_devdesc *dev)
|
||||
|
||||
out:
|
||||
if (error) {
|
||||
free(od->od_partitions);
|
||||
if (od->od_nparts > 0)
|
||||
free(od->od_partitions);
|
||||
od->od_flags &= ~BD_GPTOK;
|
||||
}
|
||||
return (error);
|
||||
@ -1044,7 +1045,7 @@ bd_closedisk(struct open_disk *od)
|
||||
delay(3000000);
|
||||
#endif
|
||||
#ifdef LOADER_GPT_SUPPORT
|
||||
if (od->od_flags & BD_GPTOK)
|
||||
if (od->od_flags & BD_GPTOK && od->od_nparts > 0)
|
||||
free(od->od_partitions);
|
||||
#endif
|
||||
free(od);
|
||||
|
Loading…
Reference in New Issue
Block a user