]> git.baikalelectronics.ru Git - kernel.git/commit
drivers: misc: ti-st: fix potential race if st_kim_start fails
authorOleksandr Kozaruk <alkhozar@gmail.com>
Thu, 29 Aug 2013 07:55:48 +0000 (10:55 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Aug 2013 19:08:04 +0000 (12:08 -0700)
commitd6fff70cb904ab84bd5d7b46b06917d12329936b
treefbccf835005f082035fd0ab5354e65f456929800
parenta795aba508e3cda462ba0af6e8358d225676d9ab
drivers: misc: ti-st: fix potential race if st_kim_start fails

If st_kim_start() fails registered protocols should be removed. This is
done by calling st_reg_complete(), which as comment states is called
with spin lock held. But in st_register() when st_kim_start fails it
is called without holding spin lock, creating possibility of concurrent
access to st_gdata data members.
Hold spin lock while calling st_reg_complete if st_kim_start() fails.

Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@globallogic.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/ti-st/st_core.c