]> git.baikalelectronics.ru Git - kernel.git/commit
media: vimc: sen: register subdevice only after initialization
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Mon, 7 Oct 2019 13:50:01 +0000 (10:50 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 24 Oct 2019 22:00:38 +0000 (19:00 -0300)
commit844992baf3fd8a38d4390ed7dcf87beeccdd7e95
treeef0553aafb3ef56a73ef32fec1bd99eed20dc737
parente19e52a010c8a67d8c1eba57a86232f54bdd6fd3
media: vimc: sen: register subdevice only after initialization

vimc_sen_add function first registers the subdevice and then
calls tpg_alloc. If tpg_alloc fails it unregisters the subdevice
and then frees vsen, this cause double free since the release
callback that follows subdevice unregistration also frees vsen.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/vimc/vimc-sensor.c