diff --git a/src/device.c b/src/device.c index b9dba8fd6..be39847e6 100644 --- a/src/device.c +++ b/src/device.c @@ -186,7 +186,7 @@ device_add_common(const device_t *dev, void *p, void *params, int inst) devices[c] = NULL; device_priv[c] = NULL; - if (init_dev != NULL) + if ((init_dev != NULL) && (init_dev != (device_t *) dev)) free(init_dev); return (NULL);