diff --git a/sys/dev/nvmm/nvmm.c b/sys/dev/nvmm/nvmm.c index dde67e0fa1b4..764620e0f39f 100644 --- a/sys/dev/nvmm/nvmm.c +++ b/sys/dev/nvmm/nvmm.c @@ -1,4 +1,4 @@ -/* $NetBSD: nvmm.c,v 1.25 2019/10/28 09:00:08 maxv Exp $ */ +/* $NetBSD: nvmm.c,v 1.26 2020/04/26 19:31:36 maxv Exp $ */ /* * Copyright (c) 2018-2019 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nvmm.c,v 1.25 2019/10/28 09:00:08 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nvmm.c,v 1.26 2020/04/26 19:31:36 maxv Exp $"); #include #include @@ -1040,6 +1040,8 @@ nvmm_open(dev_t dev, int flags, int type, struct lwp *l) struct file *fp; int error, fd; + if (__predict_false(nvmm_impl == NULL)) + return ENXIO; if (minor(dev) != 0) return EXDEV; if (!(flags & O_CLOEXEC))