summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorKoichiro Den <den@valinux.co.jp>2026-03-20 23:01:39 +0900
committerManivannan Sadhasivam <mani@kernel.org>2026-04-03 22:04:36 +0530
commit9c55d0eb4e9d1bf229d691363fb0641a9b05d904 (patch)
tree736d4a8801136ac8a9219bc3f8a7728f0882c7d6 /drivers/misc
parent70becc1a9b453ce04f97507585afc2cf47e67b11 (diff)
downloadlwn-9c55d0eb4e9d1bf229d691363fb0641a9b05d904.tar.gz
lwn-9c55d0eb4e9d1bf229d691363fb0641a9b05d904.zip
misc: pci_endpoint_test: Use -EINVAL for small subrange size
The sub_size check ensures that each subrange is large enough for 32-bit accesses. Subranges smaller than sizeof(u32) do not satisfy this assumption, so this is a local sanity check rather than a resource exhaustion case. Return -EINVAL instead of -ENOSPC for this case. Suggested-by: Niklas Cassel <cassel@kernel.org> Signed-off-by: Koichiro Den <den@valinux.co.jp> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Reviewed-by: Niklas Cassel <cassel@kernel.org> Link: https://patch.msgid.link/20260320140139.2415480-1-den@valinux.co.jp
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/pci_endpoint_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
index 55e128ed82f0..496c8f509590 100644
--- a/drivers/misc/pci_endpoint_test.c
+++ b/drivers/misc/pci_endpoint_test.c
@@ -547,7 +547,7 @@ static int pci_endpoint_test_bar_subrange(struct pci_endpoint_test *test,
sub_size = bar_size / nsub;
if (sub_size < sizeof(u32)) {
- ret = -ENOSPC;
+ ret = -EINVAL;
goto out_clear;
}