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

Commit 085b9eac authored by Vijay kumar Tumati's avatar Vijay kumar Tumati Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: Fixing memory leak issues in camera stack



Adding memory free calls to during error conditions to
fix memory leaks in platform probe.

CRs-Fixed: 975003
Change-Id: I7ecd7586e8662eaa6ec020963831e08af424be18
Signed-off-by: default avatarVijay kumar Tumati <vtumati@codeaurora.org>
parent 99d7b718
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1566,7 +1566,8 @@ static int msm_eeprom_platform_probe(struct platform_device *pdev)
	e_ctrl->is_supported = 0;
	if (!of_node) {
		pr_err("%s dev.of_node NULL\n", __func__);
		return -EINVAL;
		rc = -EINVAL;
		goto ectrl_free;
	}

	/* Set platform device handle */
@@ -1578,7 +1579,8 @@ static int msm_eeprom_platform_probe(struct platform_device *pdev)
		struct msm_camera_cci_client), GFP_KERNEL);
	if (!e_ctrl->i2c_client.cci_client) {
		pr_err("%s failed no memory\n", __func__);
		return -ENOMEM;
		rc = -ENOMEM;
		goto ectrl_free;
	}

	e_ctrl->eboard_info = kzalloc(sizeof(
@@ -1628,7 +1630,7 @@ static int msm_eeprom_platform_probe(struct platform_device *pdev)
	}

	rc = msm_eeprom_get_dt_data(e_ctrl);
	if (rc)
	if (rc < 0)
		goto board_free;

	if (e_ctrl->userspace_probe == 0) {
@@ -1723,6 +1725,7 @@ board_free:
	kfree(e_ctrl->eboard_info);
cciclient_free:
	kfree(e_ctrl->i2c_client.cci_client);
ectrl_free:
	kfree(e_ctrl);
	return rc;
}