diff options
author | Victoria Milhoan <vicki.milhoan@freescale.com> | 2015-01-16 12:05:19 -0700 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2015-02-02 14:20:44 +0800 |
commit | 4887683c80069ba88031d4fb23bc088e1f3af683 (patch) | |
tree | 1b438fd957182f67600bc4ad431512bca9a7e571 | |
parent | 56b9b505caaa6f575ecee6cd487742aa199f79bb (diff) |
MLK-10111 Add error checking to the SECVIO module
Add an error check after mapping the SECVIO IRQ.
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
(cherry picked from commit 015acaecc54e6d78a2b266cf5588b974ed235a58)
-rw-r--r-- | drivers/crypto/caam/secvio.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/crypto/caam/secvio.c b/drivers/crypto/caam/secvio.c index e4e5341e41b8..6ff4e45e6f80 100644 --- a/drivers/crypto/caam/secvio.c +++ b/drivers/crypto/caam/secvio.c @@ -1,7 +1,7 @@ /* * SNVS Security Violation Handler - * Copyright (C) 2012-2014 Freescale Semiconductor, Inc., All Rights Reserved + * Copyright (C) 2012-2015 Freescale Semiconductor, Inc., All Rights Reserved */ #include "compat.h" @@ -213,6 +213,10 @@ static int snvs_secvio_probe(struct platform_device *pdev) return -EINVAL; } svpriv->irq = irq_of_parse_and_map(npirq, 0); + if (svpriv->irq <= 0) { + kfree(svpriv); + return -EINVAL; + } snvsregs = of_iomap(np, 0); if (!snvsregs) { |