From owner-svn-src-all@FreeBSD.ORG Tue Apr 17 10:44:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F7FB106564A; Tue, 17 Apr 2012 10:44:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE6A88FC15; Tue, 17 Apr 2012 10:44:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3HAiS1f078765; Tue, 17 Apr 2012 10:44:28 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3HAiSUL078763; Tue, 17 Apr 2012 10:44:28 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201204171044.q3HAiSUL078763@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 17 Apr 2012 10:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234374 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2012 10:44:29 -0000 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 &&