Merge pull request #190 from liuchao173/patch-3

fix opendir fails in check_platform_device
This commit is contained in:
Neil Horman 2021-08-23 09:20:37 -04:00 committed by GitHub
commit c9a955dc9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -178,10 +178,12 @@ void init_irq_class_and_type(char *savedline, struct irq_info *info, int irq)
}
#ifdef AARCH64
snprintf(irq_fullname, PATH_MAX, "%s %s", last_token, savedptr);
tmp = strchr(irq_fullname, '\n');
if (tmp)
*tmp = 0;
if (strlen(savedptr) > 0) {
snprintf(irq_fullname, PATH_MAX, "%s %s", last_token, savedptr);
tmp = strchr(irq_fullname, '\n');
if (tmp)
*tmp = 0;
}
#else
snprintf(irq_fullname, PATH_MAX, "%s", last_token);
#endif