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,6 +1043,7 @@ ioc_parse(const char *opts)
|
|||
snprintf(virtual_uart_path, sizeof(virtual_uart_path), "%s", param);
|
||||
if (tmp != NULL) {
|
||||
tmp = strtok(NULL, ",");
|
||||
if (tmp != NULL)
|
||||
ioc_boot_reason = strtoul(tmp, 0, 0);
|
||||
}
|
||||
free(param);
|
||||
|
|
Loading…
Reference in New Issue