mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
powercap/drivers/dtpm: Fix an IS_ERR() vs NULL check
The powercap_register_control_type() function never returns NULL, it
returns error pointers on error so update this check.
Fixes: a20d0ef97a
("powercap/drivers/dtpm: Add API for dynamic thermal power management")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
0fe1329b7b
commit
f8f706ad75
@ -467,9 +467,9 @@ static int __init dtpm_init(void)
|
|||||||
struct dtpm_descr **dtpm_descr;
|
struct dtpm_descr **dtpm_descr;
|
||||||
|
|
||||||
pct = powercap_register_control_type(NULL, "dtpm", NULL);
|
pct = powercap_register_control_type(NULL, "dtpm", NULL);
|
||||||
if (!pct) {
|
if (IS_ERR(pct)) {
|
||||||
pr_err("Failed to register control type\n");
|
pr_err("Failed to register control type\n");
|
||||||
return -EINVAL;
|
return PTR_ERR(pct);
|
||||||
}
|
}
|
||||||
|
|
||||||
for_each_dtpm_table(dtpm_descr)
|
for_each_dtpm_table(dtpm_descr)
|
||||||
|
Loading…
Reference in New Issue
Block a user