irqbalance: Fix the compile warning.
This patch fix the compile warningis 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@huawei.com>
This commit is contained in:
parent
123c8e5bf0
commit
7ffe84fdce
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue