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

Commit 031845a4 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Fix memory leak issue"

parents c965b244 d37e3f13
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -489,12 +489,16 @@ static int msm_vidc_probe_vidc_device(struct platform_device *pdev)
	struct device *dev;
	int nr = BASE_DEVICE_NUMBER;

	if (!vidc_driver) {
		dprintk(VIDC_ERR, "Invalid vidc driver\n");
		return -EINVAL;
	}

	core = kzalloc(sizeof(*core), GFP_KERNEL);
	if (!core || !vidc_driver) {
	if (!core) {
		dprintk(VIDC_ERR,
			"Failed to allocate memory for device core\n");
		rc = -ENOMEM;
		goto err_no_mem;
		return -ENOMEM;
	}

	dev_set_drvdata(&pdev->dev, core);
@@ -642,7 +646,6 @@ err_v4l2_register:
err_core_init:
	dev_set_drvdata(&pdev->dev, NULL);
	kfree(core);
err_no_mem:
	return rc;
}