netdev: Safely increment refcount in netdev_open().
authorJoe Stringer <joestringer@nicira.com>
Thu, 1 May 2014 23:55:05 +0000 (11:55 +1200)
committerJoe Stringer <joestringer@nicira.com>
Mon, 5 May 2014 00:21:13 +0000 (12:21 +1200)
commit5b6d8aeb2614c85beb49509714a063128bbbb2cc
treeb61e9ad44ae6cb3a06c28027caf9b48783b5f87b
parent478a8f37e3b6cf2a164a5027926b1393e9557dc4
netdev: Safely increment refcount in netdev_open().

netdev_open() would previously increment a netdev's refcount without
holding a lock for it. This commit shifts the locking to protect it.

Found by inspection.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
lib/netdev.c