Prevent concurrent usage & re-allocation of the wr_buf variable.
Based off patch by chengengjia <chengjia4574@gmail.com>.
BUG:
33001936
Change-Id: I88d78e1ec0fc9e88b1e6824c06161b67d01136ec
Signed-off-by: Andrew Chant <achant@google.com>
Git-commit:
d740e7228bd1578ed01762998b2a86e7df56e608
Git-repo: https://android.googlesource.com/kernel/msm
Signed-off-by: Dennis Cagle <d-cagle@codeaurora.org>
struct i2c_client *i2c = to_i2c_client(rmi4_data->pdev->dev.parent);
struct i2c_msg msg[1];
+ mutex_lock(&rmi4_data->rmi4_io_ctrl_mutex);
+
retval = synaptics_rmi4_i2c_alloc_buf(rmi4_data, length + 1);
if (retval < 0)
- return retval;
-
- mutex_lock(&rmi4_data->rmi4_io_ctrl_mutex);
+ goto exit;
retval = synaptics_rmi4_i2c_set_page(rmi4_data, addr);
if (retval != PAGE_SELECT_LEN) {