From f530fbb7a18f2794e4178dfb7cd07719b9586147 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 8 May 2024 05:43:32 +0200 Subject: Merging upstream version 4.19.269. Signed-off-by: Daniel Baumann --- fs/kernfs/dir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'fs/kernfs/dir.c') diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index 99627d343..5a4e3aa8b 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c @@ -1513,8 +1513,11 @@ int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name, mutex_lock(&kernfs_mutex); kn = kernfs_find_ns(parent, name, ns); - if (kn) + if (kn) { + kernfs_get(kn); __kernfs_remove(kn); + kernfs_put(kn); + } mutex_unlock(&kernfs_mutex); -- cgit v1.2.3