On 06/09/2016 10:35 PM, Mauro Carvalho Chehab wrote:
The above code is racy, as some other request to the frontend may arrive between the if() statement and kfree(). A kref would likely be safer.
Here is working proof-of-concept hack. It is for si2157 tuner module. It prevents module unbind and unload when module is active. Of course it is not safe. Some more work needed in order to allow runtime bind (I tested it earlier with a8293 and unbind + bind was possible for deactive module at that time).
https://git.linuxtv.org/anttip/media_tree.git/log/?h=unbind_poc regards Antti -- http://palosaari.fi/ -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html