From: Chanwoo Choi Date: Fri, 19 Jul 2024 09:51:14 +0000 (+0900) Subject: pass: pmqos: Fix unreachable code when using pass_pmqos_exit() X-Git-Tag: accepted/tizen/unified/20240722.104306~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F07%2F314807%2F1;p=platform%2Fcore%2Fsystem%2Fpass.git pass: pmqos: Fix unreachable code when using pass_pmqos_exit() Fix unreachable code when using pass_pmqos_exit() by returning the error code if failed. Before this patch, the usage code of pass_pmqos_exit() is not able to receive the any error code. Change-Id: I4034bcc7e6ef57e5d284d919acd4e469634c637b Signed-off-by: Chanwoo Choi --- diff --git a/src/pass/pass-pmqos.c b/src/pass/pass-pmqos.c index 62547fe..28c67a3 100644 --- a/src/pass/pass-pmqos.c +++ b/src/pass/pass-pmqos.c @@ -184,6 +184,9 @@ int pass_pmqos_init(struct pass_resource *res) int pass_pmqos_exit(struct pass_resource *res) { + if (!res) + return -EINVAL; + /* Un-register DEVICE_NOTIFIER_PMQOS */ unregister_notifier(DEVICE_NOTIFIER_PMQOS, pmqos_notifier_cb, res);