--- Gnu-Mach/i386/i386at/i386at_ds_routines.c 2020/09/02 04:36:58 1.1 +++ Gnu-Mach/i386/i386at/i386at_ds_routines.c 2020/09/02 04:44:39 1.1.1.3 @@ -1,4 +1,4 @@ -/* +/* * Mach device server routines (i386at version). * * Copyright (c) 1996 The University of Utah and @@ -35,7 +35,10 @@ #include #include -#include + +#ifdef LINUX_DEV +#include +#endif extern struct device_emulation_ops mach_device_emulation_ops; #ifdef LINUX_DEV @@ -270,6 +273,8 @@ device_reference (device_t dev) void device_deallocate (device_t dev) { + if (dev == DEVICE_NULL) + return; if (dev->emul_ops->dealloc) (*dev->emul_ops->dealloc) (dev->emul_data); }