From 95b2a034784658c4512db846918475d4954901d6 Mon Sep 17 00:00:00 2001 From: Zhen Lei Date: Sat, 26 Nov 2022 19:16:34 +0800 Subject: kernfs: remove an unused if statement in kernfs_path_from_node_locked() It makes no sense to call kernfs_path_from_node_locked() with NULL buf, and no one is doing that right now. Suggested-by: Tejun Heo Signed-off-by: Zhen Lei Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20221126111634.1994-1-thunder.leizhen@huawei.com Signed-off-by: Greg Kroah-Hartman --- fs/kernfs/dir.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'fs/kernfs') diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index 935ef8cb02b2..7b13b1c3424c 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c @@ -149,9 +149,6 @@ static int kernfs_path_from_node_locked(struct kernfs_node *kn_to, if (kn_from == kn_to) return strlcpy(buf, "/", buflen); - if (!buf) - return -EINVAL; - common = kernfs_common_ancestor(kn_from, kn_to); if (WARN_ON(!common)) return -EINVAL; -- cgit v1.2.3-58-ga151