staging/bcm2835-isp: Fix cleanup after init fail
authorPhil Elwell <phil@raspberrypi.com>
Thu, 16 Dec 2021 16:25:00 +0000 (16:25 +0000)
committerPhil Elwell <phil@raspberrypi.com>
Thu, 16 Dec 2021 16:31:18 +0000 (16:31 +0000)
commit3ec9b52daa865f1253caf56f243f699c5a796ff7
tree9339855ce658cbbfbbb9a867d1d2711f5ee54e5b
parentd45d9fd038ccabeec5beeb3298d54bf10917b6d5
staging/bcm2835-isp: Fix cleanup after init fail

bcm2835_isp_remove is called on an initialisation failure, but at that
point the drvdata hasn't been set. This causes a crash when e.g. using
the cutdown firmware (gpu_mem=16).

Move platform_set_drvdata before the instance probing loop to avoid the
problem.

See: https://github.com/raspberrypi/linux/issues/4774

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c