diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2025-02-21 09:11:25 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2025-02-21 09:11:25 -0800 |
commit | 7108b48e9666a1cf010f83d65546666e17496f8b (patch) | |
tree | c399af29cb63daf60c10dc73265323eb9be46a35 | |
parent | a3daad8215143340c0870c5489e599fd059037e9 (diff) | |
parent | d403120cb9d4787b283ea202b2162f459d18fe9d (diff) |
Merge tag 'acpi-6.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fix from Rafael Wysocki:
"Fix a memory leak in the ACPI platform_profile driver (Kurt Borja)"
* tag 'acpi-6.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI: platform_profile: Fix memory leak in profile_class_is_visible()
-rw-r--r-- | drivers/acpi/platform_profile.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c index fc92e43d0fe9..2ad53cc6aae5 100644 --- a/drivers/acpi/platform_profile.c +++ b/drivers/acpi/platform_profile.c @@ -417,8 +417,14 @@ static int profile_class_registered(struct device *dev, const void *data) static umode_t profile_class_is_visible(struct kobject *kobj, struct attribute *attr, int idx) { - if (!class_find_device(&platform_profile_class, NULL, NULL, profile_class_registered)) + struct device *dev; + + dev = class_find_device(&platform_profile_class, NULL, NULL, profile_class_registered); + if (!dev) return 0; + + put_device(dev); + return attr->mode; } |