ANDROID: binder: init desired_prio.sched_policy before use it
authorGanesh Mahendran <opensource.ganesh@gmail.com>
Wed, 27 Sep 2017 07:12:25 +0000 (15:12 +0800)
committerDanny Wood <danwood76@gmail.com>
Fri, 8 Nov 2019 12:03:13 +0000 (12:03 +0000)
In function binder_transaction_priority(), we access
desired_prio before initialzing it.

This patch fix this.

Change-Id: I9d14d50f9a128010476a65b52631630899a44633
Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
drivers/android/binder.c

index 1b46e4cce926640d43c1d86cf2146a0206cc23d9..d52494a1742ece69fb6932f0cdf918e50ad04f4c 100644 (file)
@@ -1196,7 +1196,7 @@ static void binder_transaction_priority(struct task_struct *task,
                                        struct binder_priority node_prio,
                                        bool inherit_rt)
 {
-       struct binder_priority desired_prio;
+       struct binder_priority desired_prio = t->priority;
 
        if (t->set_priority_called)
                return;
@@ -1208,9 +1208,6 @@ static void binder_transaction_priority(struct task_struct *task,
        if (!inherit_rt && is_rt_policy(desired_prio.sched_policy)) {
                desired_prio.prio = NICE_TO_PRIO(0);
                desired_prio.sched_policy = SCHED_NORMAL;
-       } else {
-               desired_prio.prio = t->priority.prio;
-               desired_prio.sched_policy = t->priority.sched_policy;
        }
 
        if (node_prio.prio < t->priority.prio ||