> Free the adap structure only after we are done using it. This information can be reasonable. > This patch just moves the put_device() down a bit to avoid the > use after free. I suggest to reconsider such a change because a device reference count should eventually be decremented before decrementing the reference count for the module which is managed by this programming interface. Would you like to clarify the dependencies for such an use case any more? Regards, Markus