]> 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)
commitb36eed993a11c9231fe1f7293ce57f22a6a5ab0a
treeef0553aafb3ef56a73ef32fec1bd99eed20dc737
parentf1da568748e421cc1482144d6a906fa679ab1c5d
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