]> git.karo-electronics.de Git - karo-tx-linux.git/commit
carl9170: Fix mismatch in carl9170_op_set_key mutex lock-unlock
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Tue, 23 Aug 2011 20:44:32 +0000 (00:44 +0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 3 Oct 2011 18:39:56 +0000 (11:39 -0700)
commit8a9f335df5baa97f3901378335ff10f3fecf36de
tree29537c738161edd5254e320802c83b477561ff68
parent0b1511be7b2d36524e45a2fd70d92a2975ef0b6f
carl9170: Fix mismatch in carl9170_op_set_key mutex lock-unlock

commit 66cb54bd24086b2d871a03035de9b0e79b2b725e upstream.

If is_main_vif(ar, vif) reports that we have to fall back
to software encryption, we goto err_softw; before locking ar->mutex.
As a result, we have unprotected call to carl9170_set_operating_mode
and unmatched mutex_unlock.

The patch fix the issue by adding mutex_lock before goto.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-By: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/wireless/ath/carl9170/main.c