2019-03-29 14:12:17 +08:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2019-01-23 17:39:12 +08:00
|
|
|
From: "Zhang, Qi" <qi1.zhang@intel.com>
|
|
|
|
Date: Mon, 6 Nov 2017 12:35:31 +0800
|
2019-03-29 14:12:17 +08:00
|
|
|
Subject: [PATCH] trusty: Add null check pointer before deference
|
2019-01-23 17:39:12 +08:00
|
|
|
|
|
|
|
Add null check before deference pointer.
|
|
|
|
|
|
|
|
Change-Id: Icc9d61e17e3ecadfa1bd7fc252cf5e3d7aabb636
|
|
|
|
Signed-off-by: Zhang, Qi <qi1.zhang@intel.com>
|
|
|
|
---
|
|
|
|
drivers/trusty/trusty-irq.c | 6 ++++++
|
|
|
|
1 file changed, 6 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/drivers/trusty/trusty-irq.c b/drivers/trusty/trusty-irq.c
|
2020-05-05 09:02:46 +08:00
|
|
|
index b576729ec..868a31c01 100644
|
2019-01-23 17:39:12 +08:00
|
|
|
--- a/drivers/trusty/trusty-irq.c
|
|
|
|
+++ b/drivers/trusty/trusty-irq.c
|
|
|
|
@@ -199,6 +199,9 @@ static int trusty_irq_cpu_up(unsigned int cpu, struct hlist_node *node)
|
|
|
|
unsigned long irq_flags;
|
|
|
|
struct trusty_irq_state *is = hlist_entry_safe(node, struct trusty_irq_state, node);
|
|
|
|
|
|
|
|
+ if(is == NULL)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
dev_dbg(is->dev, "%s: cpu %d\n", __func__, smp_processor_id());
|
|
|
|
|
|
|
|
local_irq_save(irq_flags);
|
|
|
|
@@ -212,6 +215,9 @@ static int trusty_irq_cpu_down(unsigned int cpu, struct hlist_node *node)
|
|
|
|
unsigned long irq_flags;
|
|
|
|
struct trusty_irq_state *is = hlist_entry_safe(node, struct trusty_irq_state, node);
|
|
|
|
|
|
|
|
+ if(is == NULL)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
dev_dbg(is->dev, "%s: cpu %d\n", __func__, smp_processor_id());
|
|
|
|
|
|
|
|
local_irq_save(irq_flags);
|
|
|
|
--
|
2019-04-08 18:08:36 +08:00
|
|
|
https://clearlinux.org
|
2019-01-23 17:39:12 +08:00
|
|
|
|