summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
Diffstat (limited to 'usr')
-rw-r--r--usr/sysfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr/sysfs.c b/usr/sysfs.c
index 8d37c69..7f26572 100644
--- a/usr/sysfs.c
+++ b/usr/sysfs.c
@@ -168,9 +168,11 @@ struct sysfs_device *sysfs_device_get(const char *devpath)
int len;
char *pos;
+ if (!devpath)
+ return NULL;
+
/* we handle only these devpathes */
- if (devpath != NULL &&
- strncmp(devpath, "/devices/", 9) != 0 &&
+ if (strncmp(devpath, "/devices/", 9) != 0 &&
strncmp(devpath, "/subsystem/", 11) != 0 &&
strncmp(devpath, "/module/", 8) != 0 &&
strncmp(devpath, "/bus/", 5) != 0 &&