Fix panic at boot with SD/MMC readers with no media present, introduced
at r234177. Note that this is a temporary fix, until I come up with something prettier.
This commit is contained in:
parent
a4bd5210d5
commit
48ef856766
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=234374
@ -938,7 +938,9 @@ daopen(struct disk *dp)
|
||||
if (error != 0)
|
||||
xpt_print(periph->path, "unable to retrieve capacity data");
|
||||
|
||||
if (periph->flags & CAM_PERIPH_INVALID)
|
||||
if (periph->flags & CAM_PERIPH_INVALID ||
|
||||
softc->disk->d_sectorsize == 0 ||
|
||||
softc->disk->d_mediasize == 0)
|
||||
error = ENXIO;
|
||||
|
||||
if (error == 0 && (softc->flags & DA_FLAG_PACK_REMOVABLE) != 0 &&
|
||||
|
Loading…
Reference in New Issue
Block a user