diff options
author | Gregory CLEMENT <gregory.clement@free-electrons.com> | 2014-01-20 09:59:50 -0500 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2014-01-20 15:11:46 -0500 |
commit | dc4910d9e93f8cc56b190dd8fc9e789135978216 (patch) | |
tree | f50022614907067675203db3708d53eaf97635f1 /arch/arm/mach-mvebu/mvebu-soc-id.c | |
parent | 77dfdeb41125b6468790fa4c620da262c910cbc9 (diff) |
ARM: mvebu: Fix kernel hang in mvebu_soc_id_init() when of_iomap failed
When pci_base is accessed whereas it has not been properly mapped by
of_iomap() the kernel hang. The check of this pointer made an improper
use of IS_ERR() instead of comparing to NULL. This patch fix this
issue.
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Reported-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: stable@vger.kernel.org # v3.12+: af8d1c63afcb: ARM: mvebu: Add support to get the ID and the revision of a SoC
Cc: stable@vger.kernel.org # v3.12+: 85e618a1be2b: ARM: mvebu: Add quirk for i2c for the OpenBlocks AX3-4 board
Cc: stable@vger.kernel.org # v3.12+: 6cf70ae928ba: i2c: mv64xxx: Fix bus hang on A0 version of the Armada XP SoCs
Cc: stable@vger.kernel.org # v3.12+: f8b94beb7e6a: i2c: mv64xxx: Document the newly introduced Armada XP A0 compatible
Cc: stable@vger.kernel.org # v3.12+
Fixes: 930ab3d403ae (i2c: mv64xxx: Add I2C Transaction Generator support)
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'arch/arm/mach-mvebu/mvebu-soc-id.c')
-rw-r--r-- | arch/arm/mach-mvebu/mvebu-soc-id.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-mvebu/mvebu-soc-id.c b/arch/arm/mach-mvebu/mvebu-soc-id.c index fe4fc1cbdfaf..f3b325f6cbd4 100644 --- a/arch/arm/mach-mvebu/mvebu-soc-id.c +++ b/arch/arm/mach-mvebu/mvebu-soc-id.c | |||
@@ -88,7 +88,7 @@ static int __init mvebu_soc_id_init(void) | |||
88 | } | 88 | } |
89 | 89 | ||
90 | pci_base = of_iomap(child, 0); | 90 | pci_base = of_iomap(child, 0); |
91 | if (IS_ERR(pci_base)) { | 91 | if (pci_base == NULL) { |
92 | pr_err("cannot map registers\n"); | 92 | pr_err("cannot map registers\n"); |
93 | ret = -ENOMEM; | 93 | ret = -ENOMEM; |
94 | goto res_ioremap; | 94 | goto res_ioremap; |