Viacheslav Dubeyko <slava@xxxxxxxxxxx> wrote: > + mutex_lock(&monc->mutex); > kfree(monc->monmap); > + monc->monmap = NULL; > + mutex_unlock(&monc->mutex); I would do the kfree after the locked region: mutex_lock(&monc->mutex); old_monmap = monc->monmap; monc->monmap = NULL; mutex_unlock(&monc->mutex); kfree(old_monmap); David