diff options
Diffstat (limited to 'sys/scsi')
-rw-r--r-- | sys/scsi/cd.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index a9046485b64..8baa37cd1cf 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd.c,v 1.57 2001/10/25 12:59:21 drahn Exp $ */ +/* $OpenBSD: cd.c,v 1.58 2002/02/01 10:06:18 hin Exp $ */ /* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */ /* @@ -515,18 +515,18 @@ cdstrategy(bp) SC_DEBUG(cd->sc_link, SDEV_DB1, ("%ld bytes @ blk %d\n", bp->b_bcount, bp->b_blkno)); /* - * The transfer must be a whole number of blocks. + * If the device has been made invalid, error out + * maybe the media changed, or no media loaded */ - if ((bp->b_bcount % cd->sc_dk.dk_label->d_secsize) != 0) { - bp->b_error = EINVAL; + if ((cd->sc_link->flags & SDEV_MEDIA_LOADED) == 0) { + bp->b_error = EIO; goto bad; } /* - * If the device has been made invalid, error out - * maybe the media changed + * The transfer must be a whole number of blocks. */ - if ((cd->sc_link->flags & SDEV_MEDIA_LOADED) == 0) { - bp->b_error = EIO; + if ((bp->b_bcount % cd->sc_dk.dk_label->d_secsize) != 0) { + bp->b_error = EINVAL; goto bad; } /* |