CV-Bowen opened a new pull request, #22343:
URL: https://github.com/apache/nuttx/pull/22343

   ## Summary
   
   `drivers/pci/pci_epc: remove an endpoint function from its controller`:
   `pci_epc_add_epf()` links the function into `epc->epf` through
   `epf->epc_node`, but `pci_epc_remove_epf()` unlinked `epf->node`, the
   function's entry in the global EPF device list. The function stayed on
   the controller's list after it was freed, and
   `pci_epf_device_unregister()` then unlinked `epf->node` a second time,
   dereferencing the NULL pointers the first `list_delete()` left behind.
   Unlink `epf->epc_node`, and only when the function was added to this
   controller.
   
   ## Impact
   
   PCI endpoint framework (`CONFIG_PCI_ENDPOINT`) only. Unregistering an
   endpoint function no longer leaves it on its controller's list or
   unlinks its device-list entry twice.
   
   ## Testing
   
   Host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu 
13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU 
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
   
   qemu-armv8a:netnsh with every PCI driver and endpoint option enabled
   (`PCI_ENDPOINT`, `PCI_QEMU_EPC`, `PCI_EPF_TEST`, ivshmem, uio, igb/igc,
   Kvaser/CTU CAN FD, 16550 PCI, virtio-pci): all objects compile with 0
   warnings. Two failures are on master as well and unrelated: the
   image does not link on arm64 with `PCI_MSIX` (`up_connect_irq`), and
   `drivers/pci/pci_epc.c` calls the old 4-argument
   `mm_initialize_pool()`, so `PCI_ENDPOINT` was built with a test-only
   patch of that call.
   
   No in-tree configuration enables `PCI_ENDPOINT` and QEMU has no
   endpoint controller, so the change is not runtime tested.
   
   No regression in rpmsg: sim:rpserver/rpproxy and 
qemu-armv8a:rpserver/rpproxy boot and pass the fixed rpmsg cases (dump, ping, 
rpmsgfs; 15/15). qemu-armv8a was built with LIBC_ENVPATH and BINFMT_CHECKEXEC 
disabled, which current master needs for nxinit to start nsh there; unrelated 
to this change.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to