.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Map driver for Intel XScale PXA2xx platforms. |
---|
3 | 4 | * |
---|
4 | 5 | * Author: Nicolas Pitre |
---|
5 | 6 | * Copyright: (C) 2001 MontaVista Software Inc. |
---|
6 | | - * |
---|
7 | | - * This program is free software; you can redistribute it and/or modify |
---|
8 | | - * it under the terms of the GNU General Public License version 2 as |
---|
9 | | - * published by the Free Software Foundation. |
---|
10 | 7 | */ |
---|
11 | 8 | |
---|
12 | 9 | #include <linux/module.h> |
---|
.. | .. |
---|
69 | 66 | if (!info->map.virt) { |
---|
70 | 67 | printk(KERN_WARNING "Failed to ioremap %s\n", |
---|
71 | 68 | info->map.name); |
---|
| 69 | + kfree(info); |
---|
72 | 70 | return -ENOMEM; |
---|
73 | 71 | } |
---|
74 | | - info->map.cached = |
---|
75 | | - ioremap_cached(info->map.phys, info->map.size); |
---|
| 72 | + info->map.cached = ioremap_cache(info->map.phys, info->map.size); |
---|
76 | 73 | if (!info->map.cached) |
---|
77 | 74 | printk(KERN_WARNING "Failed to ioremap cached %s\n", |
---|
78 | 75 | info->map.name); |
---|
.. | .. |
---|
91 | 88 | iounmap((void *)info->map.virt); |
---|
92 | 89 | if (info->map.cached) |
---|
93 | 90 | iounmap(info->map.cached); |
---|
| 91 | + kfree(info); |
---|
94 | 92 | return -EIO; |
---|
95 | 93 | } |
---|
96 | 94 | info->mtd->dev.parent = &pdev->dev; |
---|