summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-05-18 14:02:25 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2022-05-18 14:02:25 -1000
commitdbd380bbffc81f64afeb24c6188fb6889d431a80 (patch)
tree57eef06740eebe0b9793449ca6ee8dd12edbcbfd /lib
parentdb1fd3fc06420e983c2854c09f0260a66aa8dcc0 (diff)
parentfb4554c2232e44d595920f4d5c66cf8f7d13f9bc (diff)
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull misc fixes from Al Viro: "vhost race fix and a percpu_ref_init-caused cgroup double-free fix. The latter had manifested as buggered struct mount refcounting - those are also using percpu data structures, but anything that does percpu allocations could be hit" * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: Fix double fget() in vhost_net_set_backend() percpu_ref_init(): clean ->percpu_count_ref on failure
Diffstat (limited to 'lib')
-rw-r--r--lib/percpu-refcount.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/percpu-refcount.c b/lib/percpu-refcount.c
index af9302141bcf..e5c5315da274 100644
--- a/lib/percpu-refcount.c
+++ b/lib/percpu-refcount.c
@@ -76,6 +76,7 @@ int percpu_ref_init(struct percpu_ref *ref, percpu_ref_func_t *release,
data = kzalloc(sizeof(*ref->data), gfp);
if (!data) {
free_percpu((void __percpu *)ref->percpu_count_ptr);
+ ref->percpu_count_ptr = 0;
return -ENOMEM;
}