On 10/30/2016 04:52 PM, Paolo Bonzini wrote: > On 29/10/2016 22:05, Jike Song wrote: >> + mutex_lock(&group->udata.lock); >> + >> + if (!group->udata.kvm) >> + goto out; >> + >> + kvm_get_kvm(group->udata.kvm); >> + mutex_unlock(&group->udata.lock); >> + return group->udata.kvm; > > There is still a very small race window, so you need to assign > group->udata.kvm to a local variable inside the mutex, and then return. Ok, will do that, thanks :) -- Thanks, Jike -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html