struct fsnotify_event_private_data *fsn_priv;
struct inotify_event_private_data *priv;
size_t event_size = sizeof(struct inotify_event);
- size_t name_len;
+ size_t name_len = 0;
/* we get the inotify watch descriptor from the event private data */
spin_lock(&event->lock);
inotify_free_event_priv(fsn_priv);
}
- /* round up event->name_len so it is a multiple of event_size
+ /*
+ * round up event->name_len so it is a multiple of event_size
* plus an extra byte for the terminating '\0'.
*/
- name_len = roundup(event->name_len + 1, event_size);
+ if (event->name_len)
+ name_len = roundup(event->name_len + 1, event_size);
inotify_event.len = name_len;
inotify_event.mask = inotify_mask_to_arg(event->mask);