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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 < sev->in_use; i++) {
>		list_del(&sev->events[sev_pos(sev, i)].list);
>		fh->navailable--;
>	}
>
> It's untested, but this should do the trick.

Agreed, I've modified my patch to use this construction instead.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux