ACPI / CPPC: set an error code on probe error path
Subsystems (3)
PATCH 1/1 ACPI / CPPC: set an error code on probe error path
We should return -EINVAL if get_cpu_device() fails.
drivers/acpi/cppc_acpi.c +3 -1
@@ -784,8 +784,10 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)/* Add per logical CPU nodes for reading its feedback counters. */ cpu_dev =get_cpu_device (pr->id); -if (!cpu_dev) +if (!cpu_dev) { + ret = -EINVAL ; goto out_free; + } ret =kobject_init_and_add (&cpc_ptr->kobj, &cppc_ktype, &cpu_dev->kobj,"acpi_cppc" );
Rafael J. Wysocki
maintainerQuoted 10 lines · Dan Carpenter
We should return
-EINVALifget_cpu_device()fails.Fixes 158c998ea44b ("ACPI / CPPC: add sysfs support to compute delivered performance")Signed-off-by Dan Carpenter <[email protected]>drivers/acpi/cppc_acpi.c +0
-0
drivers/acpi/cppc_acpi.c int acpi_cppc_processor_probe(struct acpi_processor *pr) · line 788
Quoted 6 lines
drivers/acpi/cppc_acpi.c +2
-1@@ -784,8 +784,10 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)/* Add per logical CPU nodes for reading its feedback counters. */ cpu_dev =get_cpu_device (pr->id); -if (!cpu_dev) +if (!cpu_dev) { + ret = -EINVAL ;
ret is initialized here AFAICS.
Do you that its value is not the right one?
drivers/acpi/cppc_acpi.c int acpi_cppc_processor_probe(struct acpi_processor *pr)
Quoted 6 lines
drivers/acpi/cppc_acpi.c +1
-1goto out_free; + } ret =kobject_init_and_add (&cpc_ptr->kobj, &cppc_ktype, &cpu_dev->kobj,"acpi_cppc" ); --
Thanks,
Rafael
Rafael J. Wysocki
maintainerQuoted 20 lines · Rafael J. Wysocki
Quoted 10 lines · Dan Carpenter
We should return
-EINVALifget_cpu_device()fails.Fixes 158c998ea44b ("ACPI / CPPC: add sysfs support to compute delivered performance")Signed-off-by Dan Carpenter <[email protected]>drivers/acpi/cppc_acpi.c +0
-0drivers/acpi/cppc_acpi.c int acpi_cppc_processor_probe(struct acpi_processor *pr) · line 788
Quoted 6 lines
drivers/acpi/cppc_acpi.c +2
-1@@ -784,8 +784,10 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)/* Add per logical CPU nodes for reading its feedback counters. */ cpu_dev =get_cpu_device (pr->id); -if (!cpu_dev) +if (!cpu_dev) { + ret = -EINVAL ;ret is initialized here AFAICS.
Quoted 1 line
Do you that its value is not the right one?
This was supposed to be "Do you mean that ...", sorry.
Quoted 7 lines
drivers/acpi/cppc_acpi.c int acpi_cppc_processor_probe(struct acpi_processor *pr)
Quoted 7 lines
drivers/acpi/cppc_acpi.c +1
-1goto out_free; + } ret =kobject_init_and_add (&cpc_ptr->kobj, &cppc_ktype, &cpu_dev->kobj,"acpi_cppc" ); --
Thanks,
Rafael
Quoted 20 lines · Rafael J. Wysocki
Quoted 10 lines · Dan Carpenter
We should return
-EINVALifget_cpu_device()fails.Fixes 158c998ea44b ("ACPI / CPPC: add sysfs support to compute delivered performance")Signed-off-by Dan Carpenter <[email protected]>drivers/acpi/cppc_acpi.c +0
-0drivers/acpi/cppc_acpi.c int acpi_cppc_processor_probe(struct acpi_processor *pr) · line 788
Quoted 6 lines
drivers/acpi/cppc_acpi.c +2
-1@@ -784,8 +784,10 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)/* Add per logical CPU nodes for reading its feedback counters. */ cpu_dev =get_cpu_device (pr->id); -if (!cpu_dev) +if (!cpu_dev) { + ret = -EINVAL ;ret is initialized here AFAICS.
Quoted 1 line
Do you that its value is not the right one?
I'm looking at linux-next. It's set to zero but we presumably want to return an error code.
regards,
dan carpenter
Rafael J. Wysocki
maintainerQuoted 21 lines · Dan Carpenter
Quoted 20 lines · Rafael J. Wysocki
Quoted 10 lines · Dan Carpenter
We should return
-EINVALifget_cpu_device()fails.Fixes 158c998ea44b ("ACPI / CPPC: add sysfs support to compute delivered performance")Signed-off-by Dan Carpenter <[email protected]>drivers/acpi/cppc_acpi.c +0
-0drivers/acpi/cppc_acpi.c int acpi_cppc_processor_probe(struct acpi_processor *pr) · line 788
Quoted 6 lines
drivers/acpi/cppc_acpi.c +2
-1@@ -784,8 +784,10 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)/* Add per logical CPU nodes for reading its feedback counters. */ cpu_dev =get_cpu_device (pr->id); -if (!cpu_dev) +if (!cpu_dev) { + ret = -EINVAL ;ret is initialized here AFAICS.
Quoted 4 lines
Quoted 1 line
Do you that its value is not the right one?
I'm looking at linux-next. It's set to zero but we presumably want to return an error code.
OK
It was slightly unclear what the bug was.
Thanks,
Rafael
Quoted 23 lines · Rafael J. Wysocki
Quoted 21 lines · Dan Carpenter
Quoted 20 lines · Rafael J. Wysocki
Quoted 10 lines · Dan Carpenter
We should return
-EINVALifget_cpu_device()fails.Fixes 158c998ea44b ("ACPI / CPPC: add sysfs support to compute delivered performance")Signed-off-by Dan Carpenter <[email protected]>drivers/acpi/cppc_acpi.c +0
-0drivers/acpi/cppc_acpi.c int acpi_cppc_processor_probe(struct acpi_processor *pr) · line 788
Quoted 6 lines
drivers/acpi/cppc_acpi.c +2
-1@@ -784,8 +784,10 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)/* Add per logical CPU nodes for reading its feedback counters. */ cpu_dev =get_cpu_device (pr->id); -if (!cpu_dev) +if (!cpu_dev) { + ret = -EINVAL ;ret is initialized here AFAICS.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Do you that its value is not the right one?
I'm looking at linux-next. It's set to zero but we presumably want to return an error code.
OK
It was slightly unclear what the bug was.
Applied now.
Thanks,
Rafael