public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] ACPI / CPPC: set an error code on probe error path
@ 2016-11-30 19:22 Dan Carpenter
  2016-11-30 21:53 ` Rafael J. Wysocki
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2016-11-30 19:22 UTC (permalink / raw)
  To: Rafael J. Wysocki, Ashwin Chaugule; +Cc: Len Brown, linux-acpi, kernel-janitors

We should return -EINVAL if get_cpu_device() fails.

Fixes: 158c998ea44b ("ACPI / CPPC: add sysfs support to compute delivered performance")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index d0d0504..e0ea8f5 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -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");

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [patch] ACPI / CPPC: set an error code on probe error path
  2016-11-30 19:22 [patch] ACPI / CPPC: set an error code on probe error path Dan Carpenter
@ 2016-11-30 21:53 ` Rafael J. Wysocki
  2016-11-30 21:55   ` Rafael J. Wysocki
  2016-11-30 22:03   ` Dan Carpenter
  0 siblings, 2 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2016-11-30 21:53 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Rafael J. Wysocki, Ashwin Chaugule, Len Brown,
	ACPI Devel Maling List, kernel-janitors

On Wed, Nov 30, 2016 at 8:22 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> We should return -EINVAL if get_cpu_device() fails.
>
> Fixes: 158c998ea44b ("ACPI / CPPC: add sysfs support to compute delivered performance")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
> index d0d0504..e0ea8f5 100644
> --- a/drivers/acpi/cppc_acpi.c
> +++ b/drivers/acpi/cppc_acpi.c
> @@ -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?

>                 goto out_free;
> +       }
>
>         ret = kobject_init_and_add(&cpc_ptr->kobj, &cppc_ktype, &cpu_dev->kobj,
>                         "acpi_cppc");
> --

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] ACPI / CPPC: set an error code on probe error path
  2016-11-30 21:53 ` Rafael J. Wysocki
@ 2016-11-30 21:55   ` Rafael J. Wysocki
  2016-11-30 22:03   ` Dan Carpenter
  1 sibling, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2016-11-30 21:55 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Dan Carpenter, Rafael J. Wysocki, Len Brown,
	ACPI Devel Maling List, kernel-janitors

On Wed, Nov 30, 2016 at 10:53 PM, Rafael J. Wysocki <rafael@kernel.org> wrote:
> On Wed, Nov 30, 2016 at 8:22 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>> We should return -EINVAL if get_cpu_device() fails.
>>
>> Fixes: 158c998ea44b ("ACPI / CPPC: add sysfs support to compute delivered performance")
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>>
>> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
>> index d0d0504..e0ea8f5 100644
>> --- a/drivers/acpi/cppc_acpi.c
>> +++ b/drivers/acpi/cppc_acpi.c
>> @@ -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?

This was supposed to be "Do you mean that ...", sorry.

>
>>                 goto out_free;
>> +       }
>>
>>         ret = kobject_init_and_add(&cpc_ptr->kobj, &cppc_ktype, &cpu_dev->kobj,
>>                         "acpi_cppc");
>> --

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] ACPI / CPPC: set an error code on probe error path
  2016-11-30 21:53 ` Rafael J. Wysocki
  2016-11-30 21:55   ` Rafael J. Wysocki
@ 2016-11-30 22:03   ` Dan Carpenter
  2016-11-30 22:14     ` Rafael J. Wysocki
  1 sibling, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2016-11-30 22:03 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Rafael J. Wysocki, Ashwin Chaugule, Len Brown,
	ACPI Devel Maling List, kernel-janitors

On Wed, Nov 30, 2016 at 10:53:55PM +0100, Rafael J. Wysocki wrote:
> On Wed, Nov 30, 2016 at 8:22 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > We should return -EINVAL if get_cpu_device() fails.
> >
> > Fixes: 158c998ea44b ("ACPI / CPPC: add sysfs support to compute delivered performance")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
> > index d0d0504..e0ea8f5 100644
> > --- a/drivers/acpi/cppc_acpi.c
> > +++ b/drivers/acpi/cppc_acpi.c
> > @@ -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?

I'm looking at linux-next.  It's set to zero but we presumably want to
return an error code.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] ACPI / CPPC: set an error code on probe error path
  2016-11-30 22:03   ` Dan Carpenter
@ 2016-11-30 22:14     ` Rafael J. Wysocki
  2016-12-01 14:14       ` Rafael J. Wysocki
  0 siblings, 1 reply; 6+ messages in thread
From: Rafael J. Wysocki @ 2016-11-30 22:14 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Rafael J. Wysocki, Rafael J. Wysocki, Ashwin Chaugule, Len Brown,
	ACPI Devel Maling List, kernel-janitors

On Wed, Nov 30, 2016 at 11:03 PM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:
> On Wed, Nov 30, 2016 at 10:53:55PM +0100, Rafael J. Wysocki wrote:
>> On Wed, Nov 30, 2016 at 8:22 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>> > We should return -EINVAL if get_cpu_device() fails.
>> >
>> > Fixes: 158c998ea44b ("ACPI / CPPC: add sysfs support to compute delivered performance")
>> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>> >
>> > diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
>> > index d0d0504..e0ea8f5 100644
>> > --- a/drivers/acpi/cppc_acpi.c
>> > +++ b/drivers/acpi/cppc_acpi.c
>> > @@ -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?
>
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] ACPI / CPPC: set an error code on probe error path
  2016-11-30 22:14     ` Rafael J. Wysocki
@ 2016-12-01 14:14       ` Rafael J. Wysocki
  0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2016-12-01 14:14 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Dan Carpenter, Ashwin Chaugule, Len Brown, ACPI Devel Maling List,
	kernel-janitors

On Wednesday, November 30, 2016 11:14:23 PM Rafael J. Wysocki wrote:
> On Wed, Nov 30, 2016 at 11:03 PM, Dan Carpenter
> <dan.carpenter@oracle.com> wrote:
> > On Wed, Nov 30, 2016 at 10:53:55PM +0100, Rafael J. Wysocki wrote:
> >> On Wed, Nov 30, 2016 at 8:22 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> >> > We should return -EINVAL if get_cpu_device() fails.
> >> >
> >> > Fixes: 158c998ea44b ("ACPI / CPPC: add sysfs support to compute delivered performance")
> >> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >> >
> >> > diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
> >> > index d0d0504..e0ea8f5 100644
> >> > --- a/drivers/acpi/cppc_acpi.c
> >> > +++ b/drivers/acpi/cppc_acpi.c
> >> > @@ -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?
> >
> > 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-12-01 14:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-30 19:22 [patch] ACPI / CPPC: set an error code on probe error path Dan Carpenter
2016-11-30 21:53 ` Rafael J. Wysocki
2016-11-30 21:55   ` Rafael J. Wysocki
2016-11-30 22:03   ` Dan Carpenter
2016-11-30 22:14     ` Rafael J. Wysocki
2016-12-01 14:14       ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox