1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-04 09:09:56 +00:00

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

MFC after:	1 week
This commit is contained in:
Andriy Gapon 2019-10-25 16:30:24 +00:00
parent 702828f643
commit 174bd5b040
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=354082

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