From: Dan Carpenter <dan.carpenter@oracle.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Ashwin Chaugule <ashwin.chaugule@linaro.org>
Cc: Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] ACPI / CPPC: set an error code on probe error path
Date: Wed, 30 Nov 2016 19:22:54 +0000 [thread overview]
Message-ID: <20161130192254.GE28180@mwanda> (raw)
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");
next reply other threads:[~2016-11-30 19:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-30 19:22 Dan Carpenter [this message]
2016-11-30 21:53 ` [patch] ACPI / CPPC: set an error code on probe error path 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161130192254.GE28180@mwanda \
--to=dan.carpenter@oracle.com \
--cc=ashwin.chaugule@linaro.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox