Salah Triki writes: > Remove useless else in order to make the code cleaner. > - if (!dev->present) { > - if (dev->open == 0) { > - mutex_unlock(&dev->lock); > + mutex_unlock(&dev->lock); > + > + if (!dev->present) > + if (dev->open == 0) > chaoskey_free(dev); > - } else > - mutex_unlock(&dev->lock); > - } else > - mutex_unlock(&dev->lock); This accesses dev->present outside of the lock region introducing a potential race condition. -- -keith