clear-pkgs-linux-iot-lts2018/1032-trusty-Fix-possible-me...

40 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Zhang, Qi" <qi1.zhang@intel.com>
Date: Mon, 12 Nov 2018 14:50:33 +0800
Subject: [PATCH] trusty: Fix possible memory leak
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
index ca6ea5799eeb..7359cf8bd3d9 100644
--- 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);
--
https://clearlinux.org