linux/drivers/staging/android
Alistair Strachan 5cf045f54d staging: sync: Fix a race condition between release_obj and print_obj
Before this change, a timeline would only be removed from the timeline
list *after* the sync driver had its release_obj() called. However, the
driver's release_obj() may free resources needed by print_obj().

Although the timeline list is locked when print_obj() is called, it is
not locked when release_obj() is called. If one CPU was in print_obj()
when another was in release_obj(), the print_obj() may make unsafe
accesses.

It is not actually necessary to hold the timeline list lock when calling
release_obj() if the call is made after the timeline is unlinked from
the list, since there is no possibility another thread could be in --
or enter -- print_obj() for that timeline.

This change moves the release_obj() call to after the timeline is
unlinked, preventing the above race from occurring.

Cc: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Alistair Strachan <alistair.strachan@imgtec.com>
[jstultz: minor commit subject tweak]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07 09:03:16 -08:00
..
ion staging: don't use module_init in non-modular ion_dummy_driver.c 2014-02-07 09:01:09 -08:00
trace
uapi
Kconfig
Makefile
TODO
alarm-dev.c
android_alarm.h
ashmem.c
ashmem.h
binder.c
binder.h
binder_trace.h
logger.c
logger.h
lowmemorykiller.c
ram_console.h
sw_sync.c
sw_sync.h staging: sw_sync: Add stubs for kernels without CONFIG_SW_SYNC 2014-02-07 09:03:16 -08:00
sync.c staging: sync: Fix a race condition between release_obj and print_obj 2014-02-07 09:03:16 -08:00
sync.h
timed_gpio.c
timed_gpio.h
timed_output.c
timed_output.h