Re: [PATCH] media: allegro: Fix use after free on error

2020-12-16 Thread Hans Verkuil
On 14/12/2020 18:16, Michael Tretter wrote: > On Mon, 14 Dec 2020 14:54:47 +0300, Dan Carpenter wrote: >> The "channel" is added to the "dev->channels" but then if >> v4l2_m2m_ctx_init() fails then we free "channel" but it's still on the >> list so it could lead to a use after free. Let's not add

Re: [PATCH] media: allegro: Fix use after free on error

2020-12-14 Thread Michael Tretter
On Mon, 14 Dec 2020 14:54:47 +0300, Dan Carpenter wrote: > The "channel" is added to the "dev->channels" but then if > v4l2_m2m_ctx_init() fails then we free "channel" but it's still on the > list so it could lead to a use after free. Let's not add it to the > list until after v4l2_m2m_ctx_init()

[PATCH] media: allegro: Fix use after free on error

2020-12-14 Thread Dan Carpenter
The "channel" is added to the "dev->channels" but then if v4l2_m2m_ctx_init() fails then we free "channel" but it's still on the list so it could lead to a use after free. Let's not add it to the list until after v4l2_m2m_ctx_init() succeeds. Fixes: cc62c74749a3 ("media: allegro: add missed check