Merge "msm: camera: cci: Add device managed alloc to balance free in remove" into camera-kernel.lnx.4.0

This commit is contained in:
Camera Software Integration 2020-02-21 13:39:41 -08:00 • committed by Gerrit - the friendly Code Review server
commit cffa3f9379

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;
}