Skip to content
Commit 19526d09 authored by Marijn Suijten's avatar Marijn Suijten Committed by Viresh Kumar
Browse files

opp: core: Check for pending links before reading required_opp pointers

Commit 4fa82a87 ("opp: Allow required-opps to be used for non genpd
use cases") dereferences the pointers in required_opp_tables but these
might be set to an ERR_PTR if the list still has lazy links pending,
resulting in segfaults.  Prior to this patch IS_ERR was also checked on
required_opp_tables[i] before reading ->is_genpd inside
_opp_table_alloc_required_tables, which is at the same time the
predicate to add this table to the lazy list.  This segfault is solved
by reordering the checks to bail on lazy pending tables before reading
->is_genpd.

Fixes: 4fa82a87

 ("opp: Allow required-opps to be used for non genpd use cases")
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Signed-off-by: default avatarMarijn Suijten <marijn.suijten@somainline.org>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent c3ddfe66
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment