[PATCH v2 0/2] misc: pci_endpoint_test: doorbell BAR validation fixes

Carlos Bilbao (Lambda) posted 2 patches 2 months ago
drivers/misc/pci_endpoint_test.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
[PATCH v2 0/2] misc: pci_endpoint_test: doorbell BAR validation fixes
Posted by Carlos Bilbao (Lambda) 2 months ago
From: Carlos Bilbao <carlos.bilbao@kernel.org>

pci_endpoint_test_doorbell() reads a BAR number from endpoint MMIO and
uses it as an array index into test->bar[].  Add a defensive bounds check
covering both out-of-range positive values and NO_BAR (-1), and remove a
dead register read that precedes the writel sequence.

Changes since v1:

- Patch 1: extend bounds check to also reject NO_BAR (-1), which is the
  Use %d (not %u) in the error message.
- Patch 2: no code change; add Reviewed-by tag.

Carlos Bilbao (2):
  misc: pci_endpoint_test: validate BAR index in doorbell test
  misc: pci_endpoint_test: remove dead BAR read before doorbell trigger

 drivers/misc/pci_endpoint_test.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

-- 
2.43.0
Re: [PATCH v2 0/2] misc: pci_endpoint_test: doorbell BAR validation fixes
Posted by Manivannan Sadhasivam 1 month, 2 weeks ago
On Fri, 10 Apr 2026 16:02:58 -0700, Carlos Bilbao (Lambda) wrote:
> From: Carlos Bilbao <carlos.bilbao@kernel.org>
> 
> pci_endpoint_test_doorbell() reads a BAR number from endpoint MMIO and
> uses it as an array index into test->bar[].  Add a defensive bounds check
> covering both out-of-range positive values and NO_BAR (-1), and remove a
> dead register read that precedes the writel sequence.
> 
> [...]

Applied, thanks!

[1/2] misc: pci_endpoint_test: validate BAR index in doorbell test
      commit: 36b80ae4206ac382fa298286277c70be1d6989fe
[2/2] misc: pci_endpoint_test: remove dead BAR read before doorbell trigger
      commit: 89b3c5044867c86e421a121481b1ca8cd00a3f6e

Best regards,
-- 
Manivannan Sadhasivam <mani@kernel.org>