Skip to content

Commit 7108b48

Browse files
committed
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()
2 parents a3daad8 + d403120 commit 7108b48

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/acpi/platform_profile.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,14 @@ static int profile_class_registered(struct device *dev, const void *data)
417417

418418
static umode_t profile_class_is_visible(struct kobject *kobj, struct attribute *attr, int idx)
419419
{
420-
if (!class_find_device(&platform_profile_class, NULL, NULL, profile_class_registered))
420+
struct device *dev;
421+
422+
dev = class_find_device(&platform_profile_class, NULL, NULL, profile_class_registered);
423+
if (!dev)
421424
return 0;
425+
426+
put_device(dev);
427+
422428
return attr->mode;
423429
}
424430

0 commit comments

Comments
 (0)