Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d59ca833 authored by Shravan Nevatia's avatar Shravan Nevatia
Browse files

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: default avatarShravan Nevatia <snevatia@codeaurora.org>
parent 911c7152
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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);