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

Commit 75965920 authored by Vishalsingh Hajeri's avatar Vishalsingh Hajeri Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: eeprom: Memory allocation using vzalloc



Use vzalloc instead of kzalloc to allocate memory for
larger data sizes.

Change-Id: Ic5aeca3029aa62c12b25d7f5843f2658586850c9
Signed-off-by: default avatarVishalsingh Hajeri <vhajeri@codeaurora.org>
parent 607ef760
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ int cam_eeprom_parse_dt_memory_map(struct device_node *node,
		return rc;
	}

	map = kzalloc((sizeof(*map) * data->num_map), GFP_KERNEL);
	map = vzalloc((sizeof(*map) * data->num_map));
	if (!map) {
		rc = -ENOMEM;
		return rc;
@@ -184,7 +184,7 @@ int cam_eeprom_parse_dt_memory_map(struct device_node *node,
		data->num_data += map[i].mem.valid_size;
	}

	data->mapdata = kzalloc(data->num_data, GFP_KERNEL);
	data->mapdata = vzalloc(data->num_data);
	if (!data->mapdata) {
		rc = -ENOMEM;
		goto ERROR;
@@ -192,7 +192,7 @@ int cam_eeprom_parse_dt_memory_map(struct device_node *node,
	return rc;

ERROR:
	kfree(data->map);
	vfree(data->map);
	memset(data, 0, sizeof(*data));
	return rc;
}