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

Commit dd2a8a62 authored by Deepak Katragadda's avatar Deepak Katragadda Committed by Gerrit - the friendly Code Review server
Browse files

msm: subsys-pil-tz: Correct initializing of stop_ack completion struct



The stop_ack completion struct is initialized after subsys_register
is called. This might lead to a race condition where the stop_ack
interrupt might be received before the stop_ack completion struct
is initialized.
Move the initialization to before the call to subsys_register is made.

Change-Id: I47db9fd892150deff317a536f086062fb324000d
Signed-off-by: default avatarDeepak Katragadda <dkatraga@codeaurora.org>
parent 4d3b805c
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -666,6 +666,8 @@ static int pil_tz_driver_probe(struct platform_device *pdev)
	if (rc)
		return rc;

	init_completion(&d->stop_ack);

	d->subsys_desc.name = d->desc.name;
	d->subsys_desc.owner = THIS_MODULE;
	d->subsys_desc.dev = &pdev->dev;
@@ -690,9 +692,6 @@ static int pil_tz_driver_probe(struct platform_device *pdev)
		goto err_subsys;
	}

	if (d->subsys_desc.stop_ack_irq)
		init_completion(&d->stop_ack);

	return 0;
err_subsys:
	destroy_ramdump_device(d->ramdump_dev);
@@ -707,9 +706,7 @@ static int pil_tz_driver_exit(struct platform_device *pdev)
	struct pil_tz_data *d = platform_get_drvdata(pdev);

	subsys_unregister(d->subsys);

	destroy_ramdump_device(d->ramdump_dev);

	pil_desc_release(&d->desc);

	return 0;