Closed vengaer closed 2 years ago
Thanks much for testing and fixes proposal.
I have pushed
sllin: Free netdev once
into master it is obviously correct and bug has been introduced when I have cherry-picked changes from Kyle's patch
sslin: update initialization to be compatible with 4,12+ and 5.4+ kernels
because I have tried to keep compatibility with all kernels and overlooked that that the free has been left there twice.
As for the other patch, I am going through code. I see no other reference to the sllin kwthread then in sllin_close and I hope that concurrent call to sllin_close in a parallel to sllin_open_common is prevented by lock on UART level. So I will merge other patch as well.
There is an excess call to
free_netdev
in thesll_free_netdev
which results in a kernel oops when either explicitly restroring the line discipline or unloading the module. Starting with 4.11.9 this is handled internally innetdev_run_todo
in net/core/dev.c after settingneeds_free_netdev
. For versions before 4.11.9, there is already a call tonetdev_free
insll_free_netdev
.67a08d3 is more of a cosmetic suggestion which probably doesn't have too much of an impact on anything. Still, I'd argue it's a worthwhile change to avoid potential future mishaps.