.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * PowerNV OPAL Powercap interface |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright 2017 IBM Corp. |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or |
---|
7 | | - * modify it under the terms of the GNU General Public License |
---|
8 | | - * as published by the Free Software Foundation; either version |
---|
9 | | - * 2 of the License, or (at your option) any later version. |
---|
10 | 6 | */ |
---|
11 | 7 | |
---|
12 | 8 | #define pr_fmt(fmt) "opal-powercap: " fmt |
---|
.. | .. |
---|
17 | 13 | |
---|
18 | 14 | #include <asm/opal.h> |
---|
19 | 15 | |
---|
20 | | -DEFINE_MUTEX(powercap_mutex); |
---|
| 16 | +static DEFINE_MUTEX(powercap_mutex); |
---|
21 | 17 | |
---|
22 | 18 | static struct kobject *powercap_kobj; |
---|
23 | 19 | |
---|
.. | .. |
---|
199 | 195 | } |
---|
200 | 196 | |
---|
201 | 197 | j = 0; |
---|
202 | | - pcaps[i].pg.name = node->name; |
---|
| 198 | + pcaps[i].pg.name = kasprintf(GFP_KERNEL, "%pOFn", node); |
---|
203 | 199 | if (has_min) { |
---|
204 | 200 | powercap_add_attr(min, "powercap-min", |
---|
205 | 201 | &pcaps[i].pattrs[j]); |
---|
.. | .. |
---|
237 | 233 | while (--i >= 0) { |
---|
238 | 234 | kfree(pcaps[i].pattrs); |
---|
239 | 235 | kfree(pcaps[i].pg.attrs); |
---|
| 236 | + kfree(pcaps[i].pg.name); |
---|
240 | 237 | } |
---|
241 | 238 | kobject_put(powercap_kobj); |
---|
242 | 239 | out_pcaps: |
---|