msm: ais: sensor: actuator: avoid accessing out of bound memory
Issue:
When total_steps is updated, after that, copy_from_user
fails with an error, then, i2c_reg_tbl is not allocated.
In this case, when calling msm_actuator_parse_i2c_params,
it lead to out-of-bound memory write.
Fix:
1) Assign total_steps to zero when error from copying.
2) Add NULL pointer check for i2c tbl.
Change-Id: I79c6409d4bc30c559a2845bb46c35fd1f4e44108
Signed-off-by:
Rahul Sharma <sharah@codeaurora.org>
Loading
Please register or sign in to comment