From a40a8e17fb398f2b34607b5e7c53acd199b77f71 Mon Sep 17 00:00:00 2001 From: guohao15 Date: Thu, 2 Nov 2023 20:20:24 +0800 Subject: [PATCH] fsnotify:fix bug when path="/" fix crash when queue event to root dir's parent Signed-off-by: guohao15 --- fs/notify/inotify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/notify/inotify.c b/fs/notify/inotify.c index dbfda950ede..16708ddef64 100644 --- a/fs/notify/inotify.c +++ b/fs/notify/inotify.c @@ -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; }