summaryrefslogtreecommitdiffstats
path: root/fs/sysfs
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2021-07-14 17:15:59 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-21 16:11:42 +0200
commitd3ce197903279c5497d4fa9cc97b519400dc4a44 (patch)
treed6a7a2511c1360bdad69f47cc114b668929b5f95 /fs/sysfs
parentselftests: firmware: Fix ignored return val of asprintf() warn (diff)
downloadlinux-d3ce197903279c5497d4fa9cc97b519400dc4a44.tar.xz
linux-d3ce197903279c5497d4fa9cc97b519400dc4a44.zip
sysfs: Use local reference in compat_only_sysfs_link_entry_to_kobj()
As we have just obtained target_kobj->sd into a local variable, and incremented the object's reference count, it is better to use the local variable instead of the original reference. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://lore.kernel.org/r/20210714151559.2532572-1-geert@linux-m68k.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/sysfs')
-rw-r--r--fs/sysfs/group.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c
index 64e6a6698935..f29d62004527 100644
--- a/fs/sysfs/group.c
+++ b/fs/sysfs/group.c
@@ -446,7 +446,7 @@ int compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj,
if (!target)
return -ENOENT;
- entry = kernfs_find_and_get(target_kobj->sd, target_name);
+ entry = kernfs_find_and_get(target, target_name);
if (!entry) {
kernfs_put(target);
return -ENOENT;