> I'm having some trouble with this one. The device_initialize() initializes > the kobj's reference counter, and then the device_add() takes another > reference on it. > > The teardown, though, only calls put_device(). Where's the call to > device_del() supposed to go that ultimately drops the last reference > to call the .release 'nvme_free_subsystem'? Yes, this is buggy. I took the code from Hannes patches without retesting a module unload. I'll go back to the drawing board.