Commit 4798cfa
committed
net: don't try to ops lock uninitialized devs
We need to be careful when operating on dev while in rtnl_create_link().
Some devices (vxlan) initialize netdev_ops in ->newlink, so later on.
Avoid using netdev_lock_ops(), the device isn't registered so we
cannot legally call its ops or generate any notifications for it.
netdev_ops_assert_locked_or_invisible() is safe to use, it checks
registration status first.
Reported-by: [email protected]
Fixes: 04efcee ("net: hold instance lock during NETDEV_CHANGE")
Acked-by: Stanislav Fomichev <[email protected]>
Reviewed-by: Kuniyuki Iwashima <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>1 parent 2a5970d commit 4798cfa
2 files changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1520 | 1520 | | |
1521 | 1521 | | |
1522 | 1522 | | |
| 1523 | + | |
| 1524 | + | |
1523 | 1525 | | |
1524 | 1526 | | |
1525 | 1527 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3676 | 3676 | | |
3677 | 3677 | | |
3678 | 3678 | | |
3679 | | - | |
3680 | | - | |
| 3679 | + | |
3681 | 3680 | | |
3682 | | - | |
3683 | | - | |
3684 | 3681 | | |
3685 | 3682 | | |
3686 | 3683 | | |
| |||
0 commit comments