diff --git a/stand/libsa/geli/gelidev.c b/stand/libsa/geli/gelidev.c index 5f1143399fb3..2dd686c81883 100644 --- a/stand/libsa/geli/gelidev.c +++ b/stand/libsa/geli/gelidev.c @@ -302,7 +302,8 @@ geli_probe_and_attach(struct open_file *f) hdesc = (struct disk_devdesc *)(f->f_devdata); /* Get the last block number for the host provider. */ - hdesc->dd.d_dev->dv_ioctl(f, DIOCGMEDIASIZE, &hmediasize); + if (hdesc->dd.d_dev->dv_ioctl(f, DIOCGMEDIASIZE, &hmediasize) != 0) + return; hlastblk = (hmediasize / DEV_BSIZE) - 1; /* Taste the host provider. If it's not geli-encrypted just return. */