diff options
author | 2017-03-27 17:42:19 +0000 | |
---|---|---|
committer | 2017-03-27 17:42:19 +0000 | |
commit | 02dcec587c88670753d065d913061aa1c2b6879a (patch) | |
tree | 2ae1b598fc91e7caaa88f5c09aff4d1a5e072bff /sys/dev/softraid.c | |
parent | rather than printing the wrong function name, dont print it at all. (diff) | |
download | wireguard-openbsd-02dcec587c88670753d065d913061aa1c2b6879a.tar.xz wireguard-openbsd-02dcec587c88670753d065d913061aa1c2b6879a.zip |
If the sub-device of a softraid lacks a side-effect io function, return
failure as early as possible.
ok mlarkin claudio
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r-- | sys/dev/softraid.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index fdde14be1df..a8365243b18 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.378 2017/03/19 16:01:08 tb Exp $ */ +/* $OpenBSD: softraid.c,v 1.379 2017/03/27 17:42:19 deraadt Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -5070,6 +5070,8 @@ sr_hibernate_io(dev_t dev, daddr_t blkno, vaddr_t addr, size_t size, int op, voi * I/O function, based on the type of device it is. */ my->subfn = get_hibernate_io_function(my->subdev); + if (!my->subfn) + return (ENODEV); /* * Find blkno where this raid partition starts on |