Re: [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: add infrastructure to change routing algorithm at runtime

Andrew Lunn
2011-11-28T19:00:31Z

Hi Marek

> +static struct bat_algo *bat_algo_get(char *name)
> +{
> + struct bat_algo *bat_algo = NULL, *bat_algo_tmp;
> + struct hlist_node *node;
> +
> + rcu_read_lock();
> + hlist_for_each_entry_rcu(bat_algo_tmp, node, &bat_algo_list, list) {
> + if (strcmp(bat_algo_tmp->name, name) != 0)
> + continue;
> +
> + bat_algo = bat_algo_tmp;

You should have a try_module_get() here, to stop the module
implementing the algorithm from being unloaded.

Andrew