diff options
author | 2025-02-21 09:11:25 -0800 | |
---|---|---|
committer | 2025-02-21 09:11:25 -0800 | |
commit | 7108b48e9666a1cf010f83d65546666e17496f8b (patch) | |
tree | c399af29cb63daf60c10dc73265323eb9be46a35 | |
parent | Merge tag 'mtd/fixes-for-6.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux (diff) | |
parent | ACPI: platform_profile: Fix memory leak in profile_class_is_visible() (diff) | |
download | wireguard-linux-7108b48e9666a1cf010f83d65546666e17496f8b.tar.xz wireguard-linux-7108b48e9666a1cf010f83d65546666e17496f8b.zip |
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()
Diffstat (limited to '')
-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; } |