Re: [RFC PATCH v4 03/12] PM: Introduce an Energy Model management framework

From: Peter Zijlstra
Date: Thu Jul 05 2018 - 10:39:34 EST


On Thu, Jun 28, 2018 at 12:40:34PM +0100, Quentin Perret wrote:
> +/**
> + * em_fd_nr_cap_states() - Get the number of capacity states of a freq. domain
> + * @fd : frequency domain for which want to do this
> + *
> + * Return: the number of capacity state in the frequency domain table
> + */
> +static inline int em_fd_nr_cap_states(struct em_freq_domain *fd)
> +{
> + struct em_cs_table *table;
> + int nr_states;
> +
> + rcu_read_lock();
> + table = rcu_dereference(fd->cs_table);
> + nr_states = table->nr_cap_states;
> + rcu_read_unlock();

So right here, we can continue to free @table...

> +
> + return nr_states;
> +}

and then what does the value we return mean?