commit | fca58f4b18e0066fc7829b152f0093daa51281e0 | [log] [tgz] |
---|---|---|
author | Tomasz Kondel <tomasz.kondel2@sonymobile.com> | Tue Nov 05 13:17:45 2013 +0100 |
committer | JP Abgrall <jpa@google.com> | Thu Nov 13 18:23:34 2014 +0000 |
tree | 04a039b708a6456bdfa3d2a9c4c7223bf382d2ad | |
parent | c325535d3de1d103d5d40c5267df9ff9325bb3e3 [diff] [blame] |
Fix segfault in get_character_device_symlinks() A segmentation fault will occur when strchr function returns NULL. Change-Id: I76076acfff16056179bf24dff5df9f81d9a45125
diff --git a/init/devices.c b/init/devices.c index 2fa5c22..a95111a 100644 --- a/init/devices.c +++ b/init/devices.c
@@ -458,7 +458,7 @@ /* skip "/devices/platform/<driver>" */ parent = strchr(uevent->path + pdev->path_len, '/'); - if (!*parent) + if (!parent) goto err; if (!strncmp(parent, "/usb", 4)) {