DM: avoid NULL pointer dereferenced in 'ioc_parse()'
Pointer 'tmp' may be NULL before passing it to 'strtoul()' Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
parent
7a09c81b10
commit
f58fe33687
|
@ -1043,7 +1043,8 @@ ioc_parse(const char *opts)
|
||||||
snprintf(virtual_uart_path, sizeof(virtual_uart_path), "%s", param);
|
snprintf(virtual_uart_path, sizeof(virtual_uart_path), "%s", param);
|
||||||
if (tmp != NULL) {
|
if (tmp != NULL) {
|
||||||
tmp = strtok(NULL, ",");
|
tmp = strtok(NULL, ",");
|
||||||
ioc_boot_reason = strtoul(tmp, 0, 0);
|
if (tmp != NULL)
|
||||||
|
ioc_boot_reason = strtoul(tmp, 0, 0);
|
||||||
}
|
}
|
||||||
free(param);
|
free(param);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue