Wait... Yanfei's patch is already applied to net tree and if I understand correctly, calling put_device() 2 times will cause UAF or smth else.It's not actually the same. The state has to be set before theAh, I see... I forgot to handle possible device_register() error. Will
device_register() or there is still a leak.
send v2 soon, thank you