summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRichard Zhu <Richard.Zhu@freescale.com>2015-11-26 09:36:48 +0800
committerNitin Garg <nitin.garg@nxp.com>2016-01-14 11:02:41 -0600
commitbbecaa396f435223500446eef63cd15fd7184e30 (patch)
treedabcc23a2c1aaace947985411e88654b2724f6d0 /include
parent3b25d94c65a9f01d83b40ba2bd87644140ebf764 (diff)
MLK-11894 imx: sema4: fix the out of bounds write
Fix the out of bounds write, and the dereference before null check. Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com> (cherry picked from commit 775ff0727166535e9b1ba1f70167e6a33fee5f13)
Diffstat (limited to 'include')
-rw-r--r--include/linux/imx_sema4.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/imx_sema4.h b/include/linux/imx_sema4.h
index fe4808908f77..19850ae7742b 100644
--- a/include/linux/imx_sema4.h
+++ b/include/linux/imx_sema4.h
@@ -29,7 +29,7 @@ enum {
SEMA4_CP1NTF = 0x88,
};
-static const unsigned int idx_sema4[16] = {
+static const unsigned int idx_sema4[SEMA4_NUM_GATES] = {
1 << 7, 1 << 6, 1 << 5, 1 << 4,
1 << 3, 1 << 2, 1 << 1, 1 << 0,
1 << 15, 1 << 14, 1 << 13, 1 << 12,
@@ -52,7 +52,7 @@ struct imx_sema4_mutex_device {
int irq;
u16 alloced;
- struct imx_sema4_mutex *mutex_ptr[16];
+ struct imx_sema4_mutex *mutex_ptr[SEMA4_NUM_GATES];
};
struct imx_sema4_mutex *