diff options
| author | Zhen Lei <[email protected]> | 2022-11-26 19:16:34 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2023-01-19 17:13:24 +0100 |
| commit | 95b2a034784658c4512db846918475d4954901d6 (patch) | |
| tree | a908721913d05fe230a8f910b59b0e64aca2fb6a | |
| parent | 52af7863508e94f3e05e43a3f2f3943a71dcffab (diff) | |
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 <[email protected]>
Signed-off-by: Zhen Lei <[email protected]>
Acked-by: Tejun Heo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
| -rw-r--r-- | fs/kernfs/dir.c | 3 |
1 files changed, 0 insertions, 3 deletions
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; |