mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
msm: camera: sensor: Add null check for read buffer
Add proper null checks for function arguments, including read buffer, before dereferencing them. CRs-Fixed: 2581538 Change-Id: I8c49bbc419e2ac5579341c7dc789da0ed1c4d123 Signed-off-by: Shravan Nevatia <snevatia@codeaurora.org>
This commit is contained in:
parent
a29622aedc
commit
9fdce6ca87
1 changed files with 6 additions and 0 deletions
|
|
@ -241,6 +241,12 @@ static int32_t cam_sensor_get_io_buffer(
|
|||
size_t buf_size = 0;
|
||||
int32_t rc = 0;
|
||||
|
||||
if (io_cfg == NULL || i2c_settings == NULL) {
|
||||
CAM_ERR(CAM_SENSOR,
|
||||
"Invalid args, io buf or i2c settings is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (io_cfg->direction == CAM_BUF_OUTPUT) {
|
||||
rc = cam_mem_get_cpu_buf(io_cfg->mem_handle[0],
|
||||
&buf_addr, &buf_size);
|
||||
|
|
|
|||
Loading…
Reference in a new issue