svn commit: r234374 - head/sys/cam/scsi
Edward Tomasz Napierala
trasz at FreeBSD.org
Tue Apr 17 10:44:29 UTC 2012
Author: trasz
Date: Tue Apr 17 10:44:28 2012
New Revision: 234374
URL: http://svn.freebsd.org/changeset/base/234374
Log:
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.
Modified:
head/sys/cam/scsi/scsi_da.c
Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c Tue Apr 17 09:18:06 2012 (r234373)
+++ head/sys/cam/scsi/scsi_da.c Tue Apr 17 10:44:28 2012 (r234374)
@@ -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 &&
More information about the svn-src-head
mailing list