staging/bcm2835-isp: Fix cleanup after init fail
authorPhil Elwell <phil@raspberrypi.com>
Thu, 16 Dec 2021 16:25:00 +0000 (16:25 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:15 +0000 (11:33 +0000)
commit49a985cc026094c3022154e8cede1967f1b2aca0
tree79b0a5bc1c9c06f0d3f07f3b143272de49673c2a
parentd12ab76ae2588d8ad90e16928d9d0a5977204e6c
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