Skip to content

Commit 98698ca

Browse files
6by9gregkh
authored andcommitted
staging: bcm2835-camera: Initialise dev in v4l2_dev
Commit 42a2f66 ("staging: vc04_services: Move global g_state to vchiq_state") changed mmal_init to pass dev->v4l2_dev.dev to vchiq_mmal_init, however nothing iniitialised dev->v4l2_dev, so we got a NULL pointer dereference. Set dev->v4l2_dev.dev during bcm2835_mmal_probe. The device pointer could be passed into v4l2_device_register to set it, however that also has other effects that would need additional changes. Fixes: 42a2f66 ("staging: vc04_services: Move global g_state to vchiq_state") Cc: stable@vger.kernel.org Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Stefan Wahren <wahrenst@gmx.net> Link: https://lore.kernel.org/r/20250423-staging-bcm2835-v4l2-fix-v2-1-3227f0ba4700@raspberrypi.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0af2f6b commit 98698ca

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,6 +1900,7 @@ static int bcm2835_mmal_probe(struct vchiq_device *device)
19001900
__func__, ret);
19011901
goto free_dev;
19021902
}
1903+
dev->v4l2_dev.dev = &device->dev;
19031904

19041905
/* setup v4l controls */
19051906
ret = bcm2835_mmal_init_controls(dev, &dev->ctrl_handler);

0 commit comments

Comments
 (0)