fix uevent action-string regression
[sfrench/cifs-2.6.git] / lib / kobject_uevent.c
index 5a402e2982afb4a1a82a28092260bb66bd921269..5b6d7f6956b98efd61d781b66675a8a6ede9f78d 100644 (file)
@@ -55,7 +55,7 @@ int kobject_action_type(const char *buf, size_t count,
        enum kobject_action action;
        int ret = -EINVAL;
 
-       if (count && buf[count-1] == '\n')
+       if (count && (buf[count-1] == '\n' || buf[count-1] == '\0'))
                count--;
 
        if (!count)