On Thu, Nov 08, 2018 at 01:46:06PM +0200, Sakari Ailus wrote:
[ upstream commit 92539d3eda2c090b382699bbb896d4b54e9bdece ]

Patch ad608fbcf166 changed how events were subscribed to address an issue
elsewhere. As a side effect of that change, the "add" callback was called
before the event subscription was added to the list of subscribed events,
causing the first event queued by the add callback (and possibly other
events arriving soon afterwards) to be lost.

Fix this by adding the subscription to the list before calling the "add"
callback, and clean up afterwards if that fails.

Fixes: ad608fbcf166 ("media: v4l: event: Prevent freeing event subscriptions while 
accessed")

Reported-by: Dave Stevenson <dave.steven...@raspberrypi.org>
Signed-off-by: Sakari Ailus <sakari.ai...@linux.intel.com>
Tested-by: Dave Stevenson <dave.steven...@raspberrypi.org>
Reviewed-by: Hans Verkuil <hans.verk...@cisco.com>
Tested-by: Hans Verkuil <hans.verk...@cisco.com>
Cc: sta...@vger.kernel.org (for 4.14 and up)
Signed-off-by: Mauro Carvalho Chehab <mchehab+sams...@kernel.org>

Hi Sakari,

For the sake of completeness, can you sign off on the backport too and
indicate it was backported to 4.9 in the commit messge? Otherwise, this
commit message says it's for 4.14+ and will suddenly appear in the 4.9
tree, and if we have issues later it might cause confusion.

--
Thanks,
Sasha

Reply via email to