summaryrefslogtreecommitdiff
path: root/drivers/staging/fsl_pme2/pme2_ctrl.c
diff options
context:
space:
mode:
authorYin Honghua-R63875 <Hong-Hua.Yin@freescale.com>2015-11-09 01:45:51 (GMT)
committerYin Honghua-R63875 <Hong-Hua.Yin@freescale.com>2015-11-09 01:45:51 (GMT)
commit61f0e119c752d7b66f974089de465729599ef7b2 (patch)
tree5fbab439958c7768eccee0d55e40e0fcab373383 /drivers/staging/fsl_pme2/pme2_ctrl.c
parentcfb981f998cf66d88f903dac8d20c52aa412482b (diff)
parent300c3ff86988bc13e310b58d9c7c786528697150 (diff)
downloadlinux-fsl-qoriq-61f0e119c752d7b66f974089de465729599ef7b2.tar.xz
Merge pull request #61 in SDK/linux-devel from ~R54964/linux-devel:bug-fix to master
* commit '300c3ff86988bc13e310b58d9c7c786528697150': fsl-qbman: Handle memory leaks fsl-pme: Check for null pointers fsl-dce: Handle memory allocation failures fsl-dce: Correct error paths and add new labels fsl_qbman: null check for lni in qman_ceemt_sp_release
Diffstat (limited to 'drivers/staging/fsl_pme2/pme2_ctrl.c')
-rw-r--r--drivers/staging/fsl_pme2/pme2_ctrl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/fsl_pme2/pme2_ctrl.c b/drivers/staging/fsl_pme2/pme2_ctrl.c
index 388162b..56e2443 100644
--- a/drivers/staging/fsl_pme2/pme2_ctrl.c
+++ b/drivers/staging/fsl_pme2/pme2_ctrl.c
@@ -138,6 +138,10 @@ static __init int parse_mem_property(struct device_node *node, const char *name,
} else if (zero) {
/* map as cacheable, non-guarded */
void *tmpp = ioremap_prot(*addr, *sz, 0);
+ if (!tmpp) {
+ pr_err("pme: Failed to remap\n");
+ return -EINVAL;
+ }
memset(tmpp, 0, *sz);
iounmap(tmpp);
}