Re: [PATCH 3/6] v4l2-event: Remove pending events from fh event queue when unsubscribing

2011-11-02 Thread Sakari Ailus
Hi Hans, On Mon, Oct 31, 2011 at 04:16:46PM +0100, Hans de Goede wrote: > The kev pointers inside the pending events queue (the available queue) of the > fh point to data inside the sev, unsubscribing frees the sev, thus making > these > pointers point to freed memory! > > This patch fixes these

Re: [PATCH 3/6] v4l2-event: Remove pending events from fh event queue when unsubscribing

2011-11-02 Thread Hans de Goede
Hi, hverkuil wrote: On Thursday, October 27, 2011 13:18:01 Hans de Goede wrote: >> 1: There is no reason for this after v4l2_event_unsubscribe releases the >> spinlock nothing is holding a reference to the sev anymore except for the >> local reference in the v4l2_event_unsubscribe function. > >

Re: [PATCH 3/6] v4l2-event: Remove pending events from fh event queue when unsubscribing

2011-11-01 Thread Hans de Goede
Hi, hverkuil wrote: > > This patch fixes these dangling pointers in the available queue by removing > > all matching pending events on unsubscription. > > The idea is fine, but the implementation is inefficient. > > Instead of the list_for_each_entry_safe you can just do: > >for (i = 0; i <

[PATCH 3/6] v4l2-event: Remove pending events from fh event queue when unsubscribing

2011-10-31 Thread Hans de Goede
The kev pointers inside the pending events queue (the available queue) of the fh point to data inside the sev, unsubscribing frees the sev, thus making these pointers point to freed memory! This patch fixes these dangling pointers in the available queue by removing all matching pending events on u

Re: [PATCH 3/6] v4l2-event: Remove pending events from fh event queue when unsubscribing

2011-10-30 Thread Hans Verkuil
On Thursday, October 27, 2011 13:18:00 Hans de Goede wrote: > The kev pointers inside the pending events queue (the available queue) of the > fh point to data inside the sev, unsubscribing frees the sev, thus making > these > pointers point to freed memory! > > This patch fixes these dangling poi

Re: [PATCH 3/6] v4l2-event: Remove pending events from fh event queue when unsubscribing

2011-10-27 Thread Laurent Pinchart
Hi Hans, On Thursday 27 October 2011 13:18:00 Hans de Goede wrote: > The kev pointers inside the pending events queue (the available queue) of > the fh point to data inside the sev, unsubscribing frees the sev, thus > making these pointers point to freed memory! > > This patch fixes these danglin

[PATCH 3/6] v4l2-event: Remove pending events from fh event queue when unsubscribing

2011-10-27 Thread Hans de Goede
The kev pointers inside the pending events queue (the available queue) of the fh point to data inside the sev, unsubscribing frees the sev, thus making these pointers point to freed memory! This patch fixes these dangling pointers in the available queue by removing all matching pending events on u