aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stand/efi/libefi/efipart.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/stand/efi/libefi/efipart.c b/stand/efi/libefi/efipart.c
index aede28ef40c3..7807c17077a6 100644
--- a/stand/efi/libefi/efipart.c
+++ b/stand/efi/libefi/efipart.c
@@ -949,8 +949,10 @@ efipart_close(struct open_file *f)
pd->pd_open--;
if (pd->pd_open == 0) {
pd->pd_blkio = NULL;
- bcache_free(pd->pd_bcache);
- pd->pd_bcache = NULL;
+ if (dev->dd.d_dev->dv_type != DEVT_DISK) {
+ bcache_free(pd->pd_bcache);
+ pd->pd_bcache = NULL;
+ }
}
if (dev->dd.d_dev->dv_type == DEVT_DISK)
return (disk_close(dev));