]> git.baikalelectronics.ru Git - kernel.git/commit
vmxnet3: fix lock imbalance in vmxnet3_tq_xmit()
authorArnd Bergmann <arnd@arndb.de>
Mon, 14 Mar 2016 14:53:57 +0000 (15:53 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Mar 2016 17:10:29 +0000 (13:10 -0400)
commit5dec4bc529b9da4927ee3643d5f5e8b1ea3e503c
tree67836a34b5fd852007bfc3b0315e99ca767bc864
parentad701a28d65b53a89ce59c8d77ee80702b389005
vmxnet3: fix lock imbalance in vmxnet3_tq_xmit()

A recent bug fix rearranged the code in vmxnet3_tq_xmit() in a
way that left the error handling for oversized headers unlock
a lock that had not been taken yet. Gcc warns about the incorrect
use of the 'flags' variable because of that:

drivers/net/vmxnet3/vmxnet3_drv.c: In function 'vmxnet3_tq_xmit.constprop':
include/linux/spinlock.h:246:3: error: 'flags' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This changes the error handling path to 'goto' the end of the function
beyond the lock/unlock pair.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: aba7572b86c4 ("vmxnet3: avoid calling pskb_may_pull with interrupts disabled")
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vmxnet3/vmxnet3_drv.c