summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/percpu-refcount.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/percpu-refcount.c b/lib/percpu-refcount.c
index b6350d13538a..e59eda07305e 100644
--- a/lib/percpu-refcount.c
+++ b/lib/percpu-refcount.c
@@ -109,7 +109,7 @@ static void __percpu_ref_exit(struct percpu_ref *ref)
if (percpu_count) {
/* non-NULL confirm_switch indicates switching in progress */
- WARN_ON_ONCE(ref->data->confirm_switch);
+ WARN_ON_ONCE(ref->data && ref->data->confirm_switch);
free_percpu(percpu_count);
ref->percpu_count_ptr = __PERCPU_REF_ATOMIC_DEAD;
}