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

Commit 155c1f5f authored by Charan Teja Reddy's avatar Charan Teja Reddy Committed by Gerrit - the friendly Code Review server
Browse files

coresight: hwtracing: fix dangling pointer issues



Fix the dangling pointer issues on CoreSight that can cause the kernel
panic.

Change-Id: Ic20405cf2f64c6bc38e994780577b7da42cf6aba
Signed-off-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
parent 4031d505
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -191,8 +191,6 @@ static int csr_probe(struct platform_device *pdev)
	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
	if (!drvdata)
		return -ENOMEM;
	/* Store the driver data pointer for use in exported functions */
	csrdrvdata = drvdata;
	drvdata->dev = &pdev->dev;
	platform_set_drvdata(pdev, drvdata);

@@ -220,6 +218,8 @@ static int csr_probe(struct platform_device *pdev)
	if (IS_ERR(drvdata->csdev))
		return PTR_ERR(drvdata->csdev);

	/* Store the driver data pointer for use in exported functions */
	csrdrvdata = drvdata;
	dev_info(dev, "CSR initialized\n");
	return 0;
}
+2 −2
Original line number Diff line number Diff line
@@ -774,8 +774,6 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)
	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
	if (!drvdata)
		return -ENOMEM;
	/* Store the driver data pointer for use in exported functions */
	stmdrvdata = drvdata;
	drvdata->dev = &adev->dev;
	dev_set_drvdata(dev, drvdata);

@@ -851,6 +849,8 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)
	if (boot_enable)
		coresight_enable(drvdata->csdev);

	/* Store the driver data pointer for use in exported functions */
	stmdrvdata = drvdata;
	return 0;
err:
	coresight_unregister(drvdata->csdev);