Skip to content

staging: bcm2835-camera: Initialise dev in v4l2_dev #6754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2025

Conversation

6by9
Copy link
Contributor

@6by9 6by9 commented Apr 1, 2025

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")

#6753

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")
Signed-off-by: Dave Stevenson <[email protected]>
Copy link
Contributor

@pelwell pelwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving on the basis that it's small and effective.

@6by9 6by9 merged commit a87a566 into raspberrypi:rpi-6.12.y Apr 2, 2025
12 of 13 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Apr 2, 2025
…se HATs

See: raspberrypi/linux#6758

kernel: ads7846 touch overlay fixups
See: raspberrypi/linux#6760

kernel: staging: bcm2835-camera: Initialise dev in v4l2_dev
See: raspberrypi/linux#6754

kernel: media: i2c: imx415: Correct hmax_min values for 891Mbps/lane
See: raspberrypi/linux#6750

kernel: PCI: pcie-brcmstb: fake MSIx support on internal MSI target
See: raspberrypi/linux#6761

kernel: DRM fixes for cropping P030/SAND128 on Pi5
See: raspberrypi/linux#6741

kernel: Show process name in set_mempolicy() ignored message
See: raspberrypi/linux#6762
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Apr 2, 2025
…se HATs

See: raspberrypi/linux#6758

kernel: ads7846 touch overlay fixups
See: raspberrypi/linux#6760

kernel: staging: bcm2835-camera: Initialise dev in v4l2_dev
See: raspberrypi/linux#6754

kernel: media: i2c: imx415: Correct hmax_min values for 891Mbps/lane
See: raspberrypi/linux#6750

kernel: PCI: pcie-brcmstb: fake MSIx support on internal MSI target
See: raspberrypi/linux#6761

kernel: DRM fixes for cropping P030/SAND128 on Pi5
See: raspberrypi/linux#6741

kernel: Show process name in set_mempolicy() ignored message
See: raspberrypi/linux#6762
@lategoodbye
Copy link
Contributor

@6by9 Thanks for fixing. Could you please send the patch upstream?

@6by9
Copy link
Contributor Author

6by9 commented Apr 10, 2025

@6by9 Thanks for fixing. Could you please send the patch upstream?

Will do.

@6by9
Copy link
Contributor Author

6by9 commented Apr 14, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants