fsnotify:fix bug when path="/"

fix crash when queue event to root dir's parent

Signed-off-by: guohao15 <guohao15@xiaomi.com>
This commit is contained in:
guohao15 2023-11-02 20:20:24 +08:00 committed by Xiang Xiao
parent 3ced80c743
commit a40a8e17fb

View File

@ -795,7 +795,7 @@ static void inotify_queue_parent_event(FAR char *path, uint32_t mask,
FAR char *name;
name = basename(path);
if (name == NULL)
if (name == NULL || (strcmp(path, "/") == 0))
{
return;
}