media prompts: recognize V4L2 check_state callback invariant#339
Merged
rgushchin merged 2 commits intoJul 20, 2026
Merged
Conversation
Signed-off-by: OllieinCanada <73385593+OllieinCanada@users.noreply.github.com>
OllieinCanada
marked this pull request as ready for review
July 19, 2026 18:52
Member
|
Thank you for the PR! Prompt changes look good to me, but I'd drop the rest. I don't think we want to add tests like this right now - they might not be stable due to the nature of LLMs. We can return to this question separately. Also, please don't change the REVISION file. Let's just change the prompt and the index file. Thanks! |
Signed-off-by: OllieinCanada <73385593+OllieinCanada@users.noreply.github.com>
Contributor
Author
|
Thanks for the review. I’ve narrowed the PR to the Media/V4L2 prompt and subsystem index only, and removed the tests, fixtures, prompt-bundle changes, README update, and REVISION change. The cumulative diff now contains only those two files. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #334
Summary
Teach Sashiko to account for caller-side V4L2 subdevice state validation before
reporting a possible NULL dereference involving
v4l2_subdev_state_get_format()inside a registered driver callback.The Media/V4L2 subsystem prompt requires the reviewer to inspect the actual
media-core callback path and dismiss the concern only when the matching wrapper
proves that the same state, pad, stream, operation, and relevant configuration
were validated before callback dispatch.
Root cause
The affected driver callbacks are reached indirectly through V4L2 operation
tables. Their validating wrappers live in the media core rather than in the
driver callback itself.
Reviewing only the callback can therefore make a protected lookup appear to be
an unchecked dereference.
Changes
guard is conditional, or the required context is unavailable
Scope
This change does not assume that
v4l2_subdev_state_get_format()is globally non-NULL and does not suppressV4L2 NULL-dereference findings broadly.
Following maintainer feedback, the submitted diff is intentionally limited to
the subsystem prompt and its index entry.
Validation
prompt and subsystem index
git diff --checkpasses