| .. | .. |
|---|
| 8 | 8 | |
|---|
| 9 | 9 | #include <linux/clk.h> |
|---|
| 10 | 10 | #include <linux/clk-provider.h> |
|---|
| 11 | +#include <linux/io.h> |
|---|
| 11 | 12 | #include <linux/kernel.h> |
|---|
| 12 | 13 | #include <linux/of.h> |
|---|
| 13 | 14 | #include <linux/of_address.h> |
|---|
| .. | .. |
|---|
| 285 | 286 | int n, ret; |
|---|
| 286 | 287 | |
|---|
| 287 | 288 | clk_data = kzalloc(struct_size(clk_data, hws, MAX_CLKS), GFP_KERNEL); |
|---|
| 288 | | - if (!clk_data) |
|---|
| 289 | + if (!clk_data) { |
|---|
| 290 | + of_node_put(parent_np); |
|---|
| 289 | 291 | return; |
|---|
| 292 | + } |
|---|
| 290 | 293 | clk_data->num = MAX_CLKS; |
|---|
| 291 | 294 | hws = clk_data->hws; |
|---|
| 292 | 295 | |
|---|
| 293 | 296 | gbase = of_iomap(parent_np, 0); |
|---|
| 294 | 297 | if (!gbase) { |
|---|
| 298 | + of_node_put(parent_np); |
|---|
| 295 | 299 | pr_err("%pOF: Unable to map global base\n", np); |
|---|
| 296 | 300 | return; |
|---|
| 297 | 301 | } |
|---|
| 298 | 302 | |
|---|
| 299 | 303 | /* BG2Q CPU PLL is not part of global registers */ |
|---|
| 300 | 304 | cpupll_base = of_iomap(parent_np, 1); |
|---|
| 305 | + of_node_put(parent_np); |
|---|
| 301 | 306 | if (!cpupll_base) { |
|---|
| 302 | 307 | pr_err("%pOF: Unable to map cpupll base\n", np); |
|---|
| 303 | 308 | iounmap(gbase); |
|---|