Prevent race conditions in synaptics fw update

Based on ANDROID-31252388 code snippet.

The global variable fwu is accessible in the fwu_sysfs_image_size_store
and fwu_sysfs_store_image functions without any locks. This results in
a potential race condition leading to a heap overflow.

Add locks to prevent the potential race condition.

Depends-On: Ibdbaf5da1400a9a81e128ff79dec3edba654c86d

Change-Id: I0947ab423d90991afdae8ffba43ea4356606acb9
2 files changed