Commit ec988ad
phy: Don't increment MDIO bus refcount unless it's a different owner
Commit 3e3aaf6 ("phy: fix mdiobus module safety") fixed the way we
dealt with MDIO bus module reference count, but sort of introduced a
regression in that, if an Ethernet driver registers its own MDIO bus
driver, as is common, we will end up with the Ethernet driver's
module->refnct set to 1, thus preventing this driver from any removal.
Fix this by comparing the network device's device driver owner against
the MDIO bus driver owner, and only if they are different, increment the
MDIO bus module refcount.
Fixes: 3e3aaf6 ("phy: fix mdiobus module safety")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent a50af86 commit ec988ad
1 file changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
857 | 857 | | |
858 | 858 | | |
859 | 859 | | |
| 860 | + | |
860 | 861 | | |
861 | 862 | | |
862 | 863 | | |
863 | 864 | | |
864 | | - | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
865 | 871 | | |
866 | 872 | | |
867 | 873 | | |
| |||
921 | 927 | | |
922 | 928 | | |
923 | 929 | | |
924 | | - | |
| 930 | + | |
| 931 | + | |
925 | 932 | | |
926 | 933 | | |
927 | 934 | | |
| |||
971 | 978 | | |
972 | 979 | | |
973 | 980 | | |
| 981 | + | |
| 982 | + | |
974 | 983 | | |
975 | 984 | | |
976 | 985 | | |
| |||
998 | 1007 | | |
999 | 1008 | | |
1000 | 1009 | | |
1001 | | - | |
| 1010 | + | |
| 1011 | + | |
1002 | 1012 | | |
1003 | 1013 | | |
1004 | 1014 | | |
| |||
0 commit comments