OSDN Git Service

media: tw686x: Fix oops on buffer alloc failure
authorKrzysztof Ha?asa <khalasa@piap.pl>
Thu, 28 Jun 2018 21:45:07 +0000 (17:45 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:36:31 +0000 (08:36 +0200)
commit8992a70297ed01f7c898f854b1edcf4a0ad4521c
tree478a9256b5c520c556559b4c12f0a33e30d3133f
parent48a90a9e56a37d9b0fbc81ca08411c84040d5918
media: tw686x: Fix oops on buffer alloc failure

[ Upstream commit 5a1a2f63d840dc2631505b607e11ff65ac1b7d3c ]

The error path currently calls tw686x_video_free() which requires
vc->dev to be initialized, causing a NULL dereference on uninitizalized
channels.

Fix this by setting the vc->dev fields for all the channels first.

Fixes: f8afaa8dbc0d ("[media] tw686x: Introduce an interface to support multiple DMA modes")

Signed-off-by: Krzysztof Ha?asa <khalasa@piap.pl>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/pci/tw686x/tw686x-video.c