[PATCH] irqbalance: Fix the compile warning.
wanghaibin
wanghaibin.wang at huawei.com
Thu Aug 17 02:38:25 PDT 2017
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
More information about the irqbalance
mailing list