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)
commit291aca4e7bdd87a01e21d90382fd0b231b280272
treeef0553aafb3ef56a73ef32fec1bd99eed20dc737
parent4996992c4f7410e9a43aa3047e8034756cece21a
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