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

Commit 99520319 authored by Depeng Shao's avatar Depeng Shao
Browse files

msm: camera: sensor: Use vzalloc to alloc reg setting memory



Use vzalloc to alloc reg setting memory to avoid alloc
memory failed after long-running.

Change-Id: Idb19383cd799922ef7ffed9f871143ede7148c3c
Signed-off-by: default avatarDepeng Shao <depengs@codeaurora.org>
parent 966d4aa6
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -37,8 +37,7 @@ static struct i2c_settings_list*
		return NULL;

	tmp->i2c_settings.reg_setting = (struct cam_sensor_i2c_reg_array *)
		kcalloc(size, sizeof(struct cam_sensor_i2c_reg_array),
			GFP_KERNEL);
		vzalloc(size * sizeof(struct cam_sensor_i2c_reg_array));
	if (tmp->i2c_settings.reg_setting == NULL) {
		list_del(&(tmp->list));
		kfree(tmp);
@@ -61,7 +60,7 @@ int32_t delete_request(struct i2c_settings_array *i2c_array)

	list_for_each_entry_safe(i2c_list, i2c_next,
		&(i2c_array->list_head), list) {
		kfree(i2c_list->i2c_settings.reg_setting);
		vfree(i2c_list->i2c_settings.reg_setting);
		list_del(&(i2c_list->list));
		kfree(i2c_list);
	}