Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Apr 2012 10:44:28 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r234374 - head/sys/cam/scsi
Message-ID:  <201204171044.q3HAiSUL078763@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 &&



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204171044.q3HAiSUL078763>