touchscreen: fts: Fix race conditions in fts diag test interface.

fts touch driver diag core file operations were not thread safe,
allowing potentially multiple user space processes/threads to
operate on the exposed diag procfs/sysfs entry. This can cause
race while allocating/freeing/accessing global command buffer
used during diagnostics command execution. This CL fixes multiple
such races by allowing only one thread to perform file operation at
any given point of time.

Bug: 119120571
Bug: 120141034

Change-Id: Ia663988260faa948854f370c48f541fa285cc2e8
Signed-off-by: Biswajit Dash <>
3 files changed