]> git.baikalelectronics.ru Git - kernel.git/commit
staging: lirc_sasem: fix NULL pointer dereference in sasem_probe
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Mon, 29 Aug 2011 20:54:21 +0000 (00:54 +0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Sep 2011 18:46:21 +0000 (11:46 -0700)
commita158d78ff8e91950ff86e1c9f3fe6205a8754b8b
tree5b65d2d866d968b77f1d49936f4947ea7396595a
parentaec9c7895e592209fd618c5c441ed86b13fea959
staging: lirc_sasem: fix NULL pointer dereference in sasem_probe

If any memory allocation failed, goto alloc_status_switch
leads to mutex_unlock(&context->ctx_lock) while context is NULL.
The patch moves alloc_status_switch to handle error conditions
in correct way.

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

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/lirc/lirc_sasem.c