From 6be3395d0589b68df142f2d8fc670acb3c542bb8 Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Sun, 5 Nov 2006 11:40:45 +0000 Subject: [PATCH] Abort if the device doesn't exist. --- sys/dev/raid/vinum/vinumio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/raid/vinum/vinumio.c b/sys/dev/raid/vinum/vinumio.c index f2fb77e245..3c67978f1a 100644 --- a/sys/dev/raid/vinum/vinumio.c +++ b/sys/dev/raid/vinum/vinumio.c @@ -35,7 +35,7 @@ * * $Id: vinumio.c,v 1.30 2000/05/10 23:23:30 grog Exp grog $ * $FreeBSD: src/sys/dev/vinum/vinumio.c,v 1.52.2.6 2002/05/02 08:43:44 grog Exp $ - * $DragonFly: src/sys/dev/raid/vinum/vinumio.c,v 1.16 2006/09/10 01:26:36 dillon Exp $ + * $DragonFly: src/sys/dev/raid/vinum/vinumio.c,v 1.17 2006/11/05 11:40:45 corecode Exp $ */ #include "vinumhdr.h" @@ -136,6 +136,9 @@ open_drive(struct drive *drive, struct proc *p, int verbose) drive->dev = udev2dev(makeudev(devmajor, devminor), 0); + if (drive->dev == NOCDEV) + return ENODEV; + drive->dev->si_iosize_max = DFLTPHYS; if (dev_is_good(drive->dev)) drive->lasterror = dev_dopen(drive->dev, FWRITE, 0, proc0.p_ucred); -- 2.41.0