diff options
author | dfr <dfr@FreeBSD.org> | 2008-11-19 16:04:07 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 2008-11-19 16:04:07 +0000 |
commit | a24417724cb96f3cb441f632dc3e87fb79a6e536 (patch) | |
tree | 421cd6a49a93de74657e19525bf071e6b5640382 | |
parent | d8ed8b66e61ebe7d14f72986b26430fa74f6973c (diff) | |
download | FreeBSD-src-a24417724cb96f3cb441f632dc3e87fb79a6e536.zip FreeBSD-src-a24417724cb96f3cb441f632dc3e87fb79a6e536.tar.gz |
If we free the GPT partition list in bd_open_gpt() because of an error, don't
try to free it again in bd_closedisk(). While I'm here, fix a DEBUG print.
-rw-r--r-- | sys/boot/i386/libi386/biosdisk.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/boot/i386/libi386/biosdisk.c b/sys/boot/i386/libi386/biosdisk.c index 333857b..45c8cd8 100644 --- a/sys/boot/i386/libi386/biosdisk.c +++ b/sys/boot/i386/libi386/biosdisk.c @@ -969,8 +969,10 @@ bd_open_gpt(struct open_disk *od, struct i386_devdesc *dev) od->od_boff = gp->gp_start; out: - if (error) + if (error) { free(od->od_partitions); + od->od_flags &= ~BD_GPTOK; + } return (error); } @@ -1058,7 +1060,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, siz switch(rw){ case F_READ: - DEBUG("read %d from %d to %p", blks, dblk, buf); + DEBUG("read %d from %lld to %p", blks, dblk, buf); if (blks && bd_read(od, dblk, blks, buf)) { DEBUG("read error"); |