2019-03-29 14:12:17 +08:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2019-03-22 14:52:12 +08:00
|
|
|
From: "Zhang, Qi" <qi1.zhang@intel.com>
|
|
|
|
Date: Mon, 12 Nov 2018 14:50:33 +0800
|
2019-03-29 14:12:17 +08:00
|
|
|
Subject: [PATCH] trusty: Fix possible memory leak
|
2019-03-22 14:52:12 +08:00
|
|
|
|
|
|
|
Destroy workqueue for failed case
|
|
|
|
|
|
|
|
Change-Id: Ibc88fb85a81579fc0f584340b35797843644d1cf
|
|
|
|
Tracked-On: PKT-1809
|
|
|
|
Signed-off-by: Zhang, Qi <qi1.zhang@intel.com>
|
|
|
|
---
|
|
|
|
drivers/trusty/trusty-timer.c | 4 ++--
|
|
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/drivers/trusty/trusty-timer.c b/drivers/trusty/trusty-timer.c
|
2020-10-27 02:14:06 +08:00
|
|
|
index ca6ea5799eeb..7359cf8bd3d9 100644
|
2019-03-22 14:52:12 +08:00
|
|
|
--- a/drivers/trusty/trusty-timer.c
|
|
|
|
+++ b/drivers/trusty/trusty-timer.c
|
|
|
|
@@ -143,8 +143,7 @@ static int trusty_timer_probe(struct platform_device *pdev)
|
|
|
|
ret = trusty_call_notifier_register(s->trusty_dev, &s->call_notifier);
|
|
|
|
if (ret < 0) {
|
|
|
|
dev_err(&pdev->dev, "Failed to register call notifier\n");
|
|
|
|
- kfree(s);
|
|
|
|
- return ret;
|
|
|
|
+ goto error_call_notifier;
|
|
|
|
}
|
|
|
|
|
|
|
|
INIT_WORK(&s->timer.work, timer_work_func);
|
|
|
|
@@ -153,6 +152,7 @@ static int trusty_timer_probe(struct platform_device *pdev)
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
+error_call_notifier:
|
|
|
|
destroy_workqueue(s->workqueue);
|
|
|
|
err_allocate_work_queue:
|
|
|
|
kfree(s);
|
|
|
|
--
|
2019-04-08 18:08:36 +08:00
|
|
|
https://clearlinux.org
|
2019-03-22 14:52:12 +08:00
|
|
|
|