| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 3 | | - * it under the terms of the GNU General Public License, version 2, as |
|---|
| 4 | | - * published by the Free Software Foundation. |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 7 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 8 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 9 | | - * GNU General Public License for more details. |
|---|
| 10 | | - * |
|---|
| 11 | | - * You should have received a copy of the GNU General Public License |
|---|
| 12 | | - * along with this program; if not, write to the Free Software |
|---|
| 13 | | - * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|---|
| 14 | 3 | * |
|---|
| 15 | 4 | * Copyright (C) 2013 Freescale Semiconductor, Inc. |
|---|
| 16 | | - * |
|---|
| 17 | 5 | */ |
|---|
| 18 | 6 | |
|---|
| 19 | 7 | #define pr_fmt(fmt) "fsl-pamu: %s: " fmt, __func__ |
|---|
| .. | .. |
|---|
| 543 | 531 | return ~(u32)0; |
|---|
| 544 | 532 | } |
|---|
| 545 | 533 | |
|---|
| 546 | | - for_each_node_by_type(node, "cpu") { |
|---|
| 534 | + for_each_of_cpu_node(node) { |
|---|
| 547 | 535 | prop = of_get_property(node, "reg", &len); |
|---|
| 548 | 536 | for (i = 0; i < len / sizeof(u32); i++) { |
|---|
| 549 | 537 | if (be32_to_cpup(&prop[i]) == vcpu) { |
|---|
| .. | .. |
|---|
| 1134 | 1122 | ret = create_csd(ppaact_phys, mem_size, csd_port_id); |
|---|
| 1135 | 1123 | if (ret) { |
|---|
| 1136 | 1124 | dev_err(dev, "could not create coherence subdomain\n"); |
|---|
| 1137 | | - return ret; |
|---|
| 1125 | + goto error; |
|---|
| 1138 | 1126 | } |
|---|
| 1139 | 1127 | } |
|---|
| 1140 | 1128 | |
|---|
| .. | .. |
|---|
| 1186 | 1174 | if (irq != NO_IRQ) |
|---|
| 1187 | 1175 | free_irq(irq, data); |
|---|
| 1188 | 1176 | |
|---|
| 1189 | | - if (data) { |
|---|
| 1190 | | - memset(data, 0, sizeof(struct pamu_isr_data)); |
|---|
| 1191 | | - kfree(data); |
|---|
| 1192 | | - } |
|---|
| 1177 | + kfree_sensitive(data); |
|---|
| 1193 | 1178 | |
|---|
| 1194 | 1179 | if (pamu_regs) |
|---|
| 1195 | 1180 | iounmap(pamu_regs); |
|---|