mirror of
https://github.com/JakeHillion/scx.git
synced 2024-11-26 11:30:22 +00:00
scx_layered: Fix uninitialized variable
Fix the uninitialized variable "layer" in the function match_layer which caused the compiling process to fail. "layer" is supposed to be the same as "&layers[layer_id]". Signed-off-by: I Hsin Cheng <richard120310@gmail.com>
This commit is contained in:
parent
96050f8bdd
commit
4fccc06905
@ -1030,20 +1030,17 @@ int match_layer(u32 layer_id, pid_t pid, const char *cgrp_path)
|
||||
{
|
||||
|
||||
struct task_struct *p;
|
||||
struct layer *layer;
|
||||
u32 nr_match_ors;
|
||||
struct layer *layer = &layers[layer_id];
|
||||
u32 nr_match_ors = layer->nr_match_ors;
|
||||
u64 or_idx, and_idx;
|
||||
|
||||
p = bpf_task_from_pid(pid);
|
||||
if (!p)
|
||||
return -EINVAL;
|
||||
|
||||
if (layer_id >= nr_layers || layer->nr_match_ors > MAX_LAYER_MATCH_ORS)
|
||||
if (layer_id >= nr_layers || nr_match_ors > MAX_LAYER_MATCH_ORS)
|
||||
goto err;
|
||||
|
||||
layer = &layers[layer_id];
|
||||
nr_match_ors = layer->nr_match_ors;
|
||||
|
||||
bpf_for(or_idx, 0, nr_match_ors) {
|
||||
struct layer_match_ands *ands;
|
||||
bool matched = true;
|
||||
|
Loading…
Reference in New Issue
Block a user