Re: [PATCH 10/13] fsnotify: allow groups to add private data toevents

From: Al Viro
Date: Mon Mar 23 2009 - 07:04:42 EST


On Thu, Mar 19, 2009 at 02:05:47PM -0400, Eric Paris wrote:

> -int fsnotify_add_notif_event(struct fsnotify_group *group, struct fsnotify_event *event)
> +int fsnotify_add_notif_event(struct fsnotify_group *group, struct fsnotify_event *event, struct fsnotify_event_private_data *priv)
> {
> struct fsnotify_event_holder *holder;
> struct list_head *list = &group->notification_list;
> @@ -166,6 +183,8 @@ int fsnotify_add_notif_event(struct fsnotify_group *group, struct fsnotify_event
>
> fsnotify_get_event(event);
> list_add_tail(&holder->event_list, list);
> + if (priv)
> + list_add_tail(&priv->event_list, &event->private_data_list);

Won't that leak priv if we bugger off earlier? On OOM or on finding last_event
we are OK with...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/