diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c index 71a35f575cc1..148a3b160812 100644 --- a/drivers/pci/endpoint/functions/pci-epf-vntb.c +++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c @@ -1004,7 +1004,7 @@ static ssize_t epf_ntb_##_name##_show(struct config_item *item, \ if (idx < 0 || idx >= ntb->num_mws) { \ dev_err(dev, "MW%d out of range (num_mws=%d)\n", \ win_no, ntb->num_mws); \ - return -EINVAL; \ + return -ERANGE; \ } \ idx = array_index_nospec(idx, ntb->num_mws); \ return sprintf(page, "%llu\n", ntb->mws_size[idx]); \ @@ -1032,7 +1032,7 @@ static ssize_t epf_ntb_##_name##_store(struct config_item *item, \ if (idx < 0 || idx >= ntb->num_mws) { \ dev_err(dev, "MW%d out of range (num_mws=%d)\n", \ win_no, ntb->num_mws); \ - return -EINVAL; \ + return -ERANGE; \ } \ idx = array_index_nospec(idx, ntb->num_mws); \ ntb->mws_size[idx] = val; \