]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
media: atmel: atmel-isc: fix asd memory allocation
authorEugen Hristev <eugen.hristev@microchip.com>
Fri, 12 Apr 2019 10:19:49 +0000 (06:19 -0400)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:21:44 +0000 (14:21 -0300)
commit6ed1c57ef2b189da33515be378cc17745fe3fcd4
tree890ec67714f54fdeba5650fd473fdf9cab4d322c
parente8f9f13048cc77d7ade7f2fa6a1b6ee1eedca56d
media: atmel: atmel-isc: fix asd memory allocation

BugLink: https://bugs.launchpad.net/bugs/1855787
commit 1e4e25c4959c10728fbfcc6a286f9503d32dfe02 upstream.

The subsystem will free the asd memory on notifier cleanup, if the asd is
added to the notifier.
However the memory is freed using kfree.
Thus, we cannot allocate the asd using devm_*
This can lead to crashes and problems.
To test this issue, just return an error at probe, but cleanup the
notifier beforehand.

Fixes: 106267444f ("[media] atmel-isc: add the Image Sensor Controller code")
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/media/platform/atmel/atmel-isc.c