sit: proper dev_{hold|put} in ndo_[un]init methods
After adopting CONFIG_PCPU_DEV_REFCNT=n option, syzbot was able to trigger a warning [1] Issue here is that: - all dev_put() should be paired with a corresponding prior dev_hold(). - A driver doing a dev_put() in its ndo_uninit() MUST also do a dev_hold() in its ndo_init(), only when ndo_init() is returning 0. Otherwise, register_netdevice() would call ndo_uninit() in its error path and release a refcount too soon. Fixes: 919067cc ("net: add CONFIG_PCPU_DEV_REFCNT") Signed-off-by: Eric Dumazet <edumazet@google.com> Reported-by: syzbot <syzkaller@googlegroups.com> Signed-off-by: David S. Miller <davem@davemloft.net>
parent
40cb881b
-
mentioned in commit 2993c226
-
mentioned in commit 13908efd
-
mentioned in commit 3cc5c358
-
mentioned in commit 01cc9ab6
-
mentioned in commit 873d5de7
-
mentioned in commit 867fd8d5
-
mentioned in commit 1316d11c
-
mentioned in commit 2ddf8390
-
mentioned in commit c5534ba6
-
mentioned in commit 8b0978af
-
mentioned in commit de327b40
-
mentioned in commit 2bab1206
-
mentioned in commit 3c24dbd3
-
mentioned in commit 019c426b
-
mentioned in commit ccecbcc9
-
mentioned in commit 94d970a6
-
mentioned in commit ffed1f3f
-
mentioned in commit 925b7bb6
-
mentioned in commit f5ddecb6
-
mentioned in commit b811a8a7
-
mentioned in commit 50e5c93c
Please register or sign in to comment