diff --git a/ueventd/ueventd_device_handler.c b/ueventd/ueventd_device_handler.c index d39f3a367e3c2032f42d7bb675a4946360ee8fa7..604f0d4e64115fcacb1ef75f35eab8cda47142da 100644 --- a/ueventd/ueventd_device_handler.c +++ b/ueventd/ueventd_device_handler.c @@ -134,7 +134,9 @@ static void SetDeviceLable(const char *path, char **symLinks) if (strncmp(linkName, byNamePath, strlen(byNamePath)) == 0) { (void)Restorecon(linkName); lgetfilecon(linkName, &context); - setfilecon(path, context); + if (context != NULL) { + setfilecon(path, context); + } return; } }