ems: frt: Add exception condition for frt init
authorYoungtae Lee <yt0729.lee@samsung.com>
Thu, 13 Sep 2018 10:00:36 +0000 (19:00 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:24:57 +0000 (20:24 +0300)
Change-Id: Ic69f786a4098e518fc043cc335339b6ef4822ba9
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
kernel/sched/rt.c

index 583802e0e0a0b825d8c27659600d4a3e47ebfdb2..7eb5012f1171437ad272a78d0c67788b8fe3eeb7 100644 (file)
@@ -16,7 +16,6 @@
 
 #ifdef CONFIG_SCHED_USE_FLUID_RT
 struct frt_dom {
-       bool                    enabled;
        unsigned int            coverage_ratio;
        unsigned int            coverage_thr;
        unsigned int            active_ratio;
@@ -279,10 +278,12 @@ static void frt_parse_dt(struct device_node *dn, struct frt_dom *dom, int cnt)
        if (!dom->active_ratio)
                dom->active_thr = 0;
 
-       dom->enabled = true;
        return;
 
 disable:
+       dom->coregroup = cnt;
+       dom->coverage_ratio = 100;
+       dom->active_thr = 0;
        pr_err("FRT(%s): failed to parse frt node\n", __func__);
 }
 
@@ -299,6 +300,8 @@ static int __init init_frt(void)
 
        INIT_LIST_HEAD(&frt_list);
        ptr_mask = kzalloc(sizeof(struct cpumask), GFP_KERNEL);
+       if (!ptr_mask)
+               pr_err("FRT(%s): failed to allocate ptr_mask\n");
        cpumask_setall(ptr_mask);
 
        for_each_possible_cpu(cpu) {
@@ -306,6 +309,8 @@ static int __init init_frt(void)
                        continue;
 
                dom = kzalloc(sizeof(struct frt_dom), GFP_KERNEL);
+               if (!dom)
+                       pr_err("FRT(%s): failed to allocate dom\n");
                if (cpu == 0)
                        head = dom;
 
@@ -328,7 +333,6 @@ static int __init init_frt(void)
 
                list_add_tail(&dom->list, &frt_list);
        }
-
        frt_sysfs_init();
 
        of_node_put(dn);