msm: camera: cci: Add device managed alloc to balance free in remove

The devm_kfree call in remove is unbalanced without a devm_kzalloc.
Add required kzalloc and free during probe to balance it.

CRs-Fixed: 2584631
Change-Id: I14164405e62036f7918b858d978afe454e4feb4a
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
This commit is contained in:
Mukund Madhusudan Atre 2020-02-16 22:47:44 -08:00
commit 4e5ffd3ce0

View file

@ -376,7 +376,7 @@ static int cam_cci_component_bind(struct device *dev,
int rc = 0;
struct platform_device *pdev = to_platform_device(dev);
new_cci_dev = kzalloc(sizeof(struct cci_device),
new_cci_dev = devm_kzalloc(&pdev->dev, sizeof(struct cci_device),
GFP_KERNEL);
if (!new_cci_dev)
return -ENOMEM;
@ -445,7 +445,7 @@ static int cam_cci_component_bind(struct device *dev,
CAM_DBG(CAM_CCI, "Component bound successfully");
return rc;
cci_no_resource:
kfree(new_cci_dev);
devm_kfree(&pdev->dev, new_cci_dev);
return rc;
}