Skip to content

drivers: pci: Fix endpoint null guard logic#19331

Closed
Old-Ding wants to merge 0 commit into
apache:masterfrom
Old-Ding:codex/pci-endpoint-null-guards
Closed

drivers: pci: Fix endpoint null guard logic#19331
Old-Ding wants to merge 0 commit into
apache:masterfrom
Old-Ding:codex/pci-endpoint-null-guards

Conversation

@Old-Ding

@Old-Ding Old-Ding commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • reject missing PCI endpoint MSI mapping callbacks before dereferencing the endpoint controller
  • make PCI EPF debug assertions require both the object and callback/name pointers to be valid

Rationale

The existing guard expressions used && or || in a way that could dereference a null pointer while evaluating the guard itself. The fixed checks follow the surrounding PCI endpoint guard style and keep the validation at the call boundary.

Testing

  • git diff --check
  • git show --stat --check --format=fuller HEAD
  • git ls-files --eol -- drivers\pci\pci_epc.c drivers\pci\pci_epf.c

@github-actions github-actions Bot added Size: XS The size of the change in this PR is very small Area: PCI labels Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

xiaoxiang781216
xiaoxiang781216 previously approved these changes Jul 6, 2026
jerpelea
jerpelea previously approved these changes Jul 6, 2026

@jerpelea jerpelea left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please rebase

@xiaoxiang781216

Copy link
Copy Markdown
Contributor

@Old-Ding please fix the conflict.

acassis
acassis previously approved these changes Jul 6, 2026
@acassis

acassis commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@Old-Ding please fix conflicts

@Old-Ding Old-Ding dismissed stale reviews from acassis, jerpelea, and xiaoxiang781216 via cba5969 July 8, 2026 14:01
@Old-Ding Old-Ding force-pushed the codex/pci-endpoint-null-guards branch from 89e3825 to cba5969 Compare July 8, 2026 14:01
@Old-Ding Old-Ding requested review from tmedicci and yf13 as code owners July 8, 2026 14:01
@Old-Ding Old-Ding closed this Jul 8, 2026
@Old-Ding Old-Ding force-pushed the codex/pci-endpoint-null-guards branch from cba5969 to 1fc6f2b Compare July 8, 2026 14:04
@github-actions github-actions Bot removed the Area: PCI label Jul 8, 2026
@acassis

acassis commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@Old-Ding why did you close it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants