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

Commit 57a7e9df authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: sensor: Fix to validate the settings size in flash"

parents 4e79fa4c c7369a1d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -151,6 +151,12 @@ static int32_t msm_flash_i2c_write_table(
	conf_array.reg_setting = settings->reg_setting_a;
	conf_array.size = settings->size;

	/* Validate the settings size */
	if ((!conf_array.size) || (conf_array.size > MAX_I2C_REG_SET)) {
		pr_err("failed: invalid size %d", conf_array.size);
		return -EINVAL;
	}

	return flash_ctrl->flash_i2c_client.i2c_func_tbl->i2c_write_table(
		&flash_ctrl->flash_i2c_client, &conf_array);
}