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:
Tomasz Kondel 2013-11-05 13:17:45 +01:00 committed by JP Abgrall
parent c325535d3d
commit fca58f4b18
1 changed files with 1 additions and 1 deletions

View File

@ -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)) {