superio: do not crash if failed to create the character device

MFC after:	1 week
This commit is contained in:
avg 2019-10-25 16:30:24 +00:00
parent 3f9b3c4810
commit a95b774891

View File

@ -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);
}