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

Commit ad679d74 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 2dd67a15 a416914a
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -29,8 +29,7 @@ static struct i2c_settings_list*
		return NULL;
		return NULL;


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


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