Fix segfault in get_character_device_symlinks()
A segmentation fault will occur when strchr function returns NULL. Change-Id: I76076acfff16056179bf24dff5df9f81d9a45125
This commit is contained in:
parent
c325535d3d
commit
fca58f4b18
|
@ -458,7 +458,7 @@ static char **get_character_device_symlinks(struct uevent *uevent)
|
|||
|
||||
/* skip "/devices/platform/<driver>" */
|
||||
parent = strchr(uevent->path + pdev->path_len, '/');
|
||||
if (!*parent)
|
||||
if (!parent)
|
||||
goto err;
|
||||
|
||||
if (!strncmp(parent, "/usb", 4)) {
|
||||
|
|
Loading…
Reference in New Issue