]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
netdevsim: fix unbalaced locking in nsim_create()
authorTaehee Yoo <ap420073@gmail.com>
Tue, 21 Jul 2020 14:51:50 +0000 (14:51 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jul 2020 23:00:43 +0000 (16:00 -0700)
commit2c9d8e01f0c6017317eee7638496173d4a64e6bc
tree27d0fc555fabf7010c6a04f3d79588b28c002524
parent3506b2f42dff66ea6814c3dfa1988bafb79e6f88
netdevsim: fix unbalaced locking in nsim_create()

In the nsim_create(), rtnl_lock() is called before nsim_bpf_init().
If nsim_bpf_init() is failed, rtnl_unlock() should be called,
but it isn't called.
So, unbalanced locking would occur.

Fixes: e05b2d141fef ("netdevsim: move netdev creation/destruction to dev probe")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netdevsim/netdev.c