On Thu, Sep 26, 2019 at 1:21 AM Bart Van Assche <bvanassche@xxxxxxx> wrote: > > On 9/25/19 3:53 PM, Danil Kipnis wrote: > > Oh, you mean we just need stub functions for those, so that nobody > > steps on a null? > > What I meant is that the memory that is backing a device must not be > freed until the reference count of a device has dropped to zero. If a > struct device is embedded in a larger structure that means signaling a > completion from inside the release function (ibtrs_clt_dev_release()) > and not freeing the struct device memory (kfree(clt) in free_clt()) > before that completion has been triggered. Got it, thank you. Will move free_clt into the release function.