diff --git a/sys/dev/superio/superio.c b/sys/dev/superio/superio.c index 24dc67b3d4f3..4c850ffd5047 100644 --- a/sys/dev/superio/superio.c +++ b/sys/dev/superio/superio.c @@ -636,7 +636,8 @@ superio_attach(device_t dev) UID_ROOT, GID_WHEEL, 0600, "superio%d", device_get_unit(dev)); if (sc->chardev == NULL) device_printf(dev, "failed to create character device\n"); - sc->chardev->si_drv1 = sc; + else + sc->chardev->si_drv1 = sc; return (0); }