Message ID | 20250110061639.1280907-3-chenridong@huaweicloud.com |
---|---|
State | New |
Headers | show |
Series | None | expand |
diff --git a/kernel/padata.c b/kernel/padata.c index 7d79df1e3b33..de2c02a81469 100644 --- a/kernel/padata.c +++ b/kernel/padata.c @@ -1135,6 +1135,12 @@ void padata_free_shell(struct padata_shell *ps) if (!ps) return; + /* + * Wait for all _do_serial calls to finish to avoid touching + * freed pd's and ps's. + */ + synchronize_rcu(); + mutex_lock(&ps->pinst->lock); list_del(&ps->list); pd = rcu_dereference_protected(ps->pd, 1);