From fca58f4b18e0066fc7829b152f0093daa51281e0 Mon Sep 17 00:00:00 2001 From: Tomasz Kondel Date: Tue, 5 Nov 2013 13:17:45 +0100 Subject: [PATCH] Fix segfault in get_character_device_symlinks() A segmentation fault will occur when strchr function returns NULL. Change-Id: I76076acfff16056179bf24dff5df9f81d9a45125 --- init/devices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/devices.c b/init/devices.c index 2fa5c2203..a95111a24 100644 --- a/init/devices.c +++ b/init/devices.c @@ -458,7 +458,7 @@ static char **get_character_device_symlinks(struct uevent *uevent) /* skip "/devices/platform/" */ parent = strchr(uevent->path + pdev->path_len, '/'); - if (!*parent) + if (!parent) goto err; if (!strncmp(parent, "/usb", 4)) {