I have a specific question regarding using net_device module in linux kernel.
Lets address this code example please.
When i init my device, i call alloc_netdev and provide it with the private data size , so it will properly allocate it.
Now, What happens when i call snull_cleanup when i wish to stop using this device. i see it basically free's the structure (including the private data).
The question is, what if the code currently running is an inside function inside my device module which uses the private data got by cally netdev_priv(), holdes a reference to the private data, and all of the sudden i get a context switch in kernel-space towards the snull_cleanup function - which frees the private data.
Then, when switching context back to the function holding the reference to the private data, wouldnt i get a reference to a freed structure?
I would be glad if you could sort this issue out for me, thanks
snull_privstructure. Can you clarify and paste code snippets? - Alexander Dzyoba