[PATCH] irqbalance: Fix the compile warning.

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

 



This patch fix the compile warning like as folow:

ui/irqbalance-ui.c:147:20: warning: ?ptr? may be used uninitialized
in this function [-Wmaybe-uninitialized]
   new_irq->class = strtol(strtok_r(NULL, " ", &ptr), NULL, 10);

Signed-off-by: wanghaibin <wanghaibin.wang at huawei.com>
---
 ui/irqbalance-ui.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ui/irqbalance-ui.c b/ui/irqbalance-ui.c
index 9215877..3fc46af 100644
--- a/ui/irqbalance-ui.c
+++ b/ui/irqbalance-ui.c
@@ -125,6 +125,8 @@ void parse_setup(char *setup_data)
 	char *copy;
 	if((setup_data == NULL) || (strlen(setup_data) == 0)) return;
 	copy = strdup(setup_data);
+	if (!copy)
+		return;
 
 	setup.banned_irqs = NULL;
 	setup.banned_cpus = NULL;
@@ -243,6 +245,9 @@ void parse_into_tree(char *data)
 		return;
 
 	copy = strdup(data);
+	if (!copy)
+		return;
+
 	token = strtok_r(copy, " ", &ptr);
 	while(token != NULL) {
 		/* Parse node data */
-- 
1.8.3.1





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux