pass: pmqos: Fix unreachable code when using pass_pmqos_exit() 07/314807/1
authorChanwoo Choi <cw00.choi@samsung.com>
Fri, 19 Jul 2024 09:51:14 +0000 (18:51 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 19 Jul 2024 09:51:14 +0000 (18:51 +0900)
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 <cw00.choi@samsung.com>
src/pass/pass-pmqos.c

index 62547fec66e207360d2566b9bcbe82bdf1b468dd..28c67a33ca23ed3473cd8e610aba9d9419d7e7fd 100644 (file)
@@ -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);