[PATCH] Fix for possible null pointer dereference in node.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There is otherwise a risk of a possible null pointer dereference.

Was largely found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@xxxxxxxxxxxxxxxxxx>
---
 drivers/staging/tidspbridge/rmgr/node.c |    4 ++--
 1 fil ändrad, 2 tillägg(+), 2 borttagningar(-)

diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c
index 9d3044a..94c2cce 100644
--- a/drivers/staging/tidspbridge/rmgr/node.c
+++ b/drivers/staging/tidspbridge/rmgr/node.c
@@ -2361,8 +2361,7 @@ static void delete_node(struct node_object *hnode,
 	struct node_taskargs task_arg_obj;
 #ifdef DSP_DMM_DEBUG
 	struct dmm_object *dmm_mgr;
-	struct proc_object *p_proc_object =
-	    (struct proc_object *)hnode->processor;
+	struct proc_object *p_proc_object;
 #endif
 	int status;
 	if (!hnode)
@@ -2431,6 +2430,7 @@ static void delete_node(struct node_object *hnode,
 							dsp_heap_res_addr,
 							pr_ctxt);
 #ifdef DSP_DMM_DEBUG
+			p_proc_object = (struct proc_object *)hnode->processor;
 			status = dmm_get_handle(p_proc_object, &dmm_mgr);
 			if (dmm_mgr)
 				dmm_mem_map_dump(dmm_mgr);
-- 
1.7.10.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel





[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux