misc: pci_endpoint_test: Fix pci_endpoint_test_bars_read_bar() error handling
Subsystems (3)
PATCH v2 1/1 misc: pci_endpoint_test: Fix pci_endpoint_test_bars_read_bar() error handling
Commit f26d37ee9bda ("misc: pci_endpoint_test: Fix IOCTL return value") changed the return value of pci_endpoint_test_bars_read_bar() from false to -EINVAL on error, however, it failed to update the error handling.
---
Changes since v1:
-Changed the type of the variable ret to int to match the new return type.
drivers/misc/pci_endpoint_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/misc/pci_endpoint_test.c +2 -2
@@ -382,7 +382,7 @@ static int pci_endpoint_test_bars_read_bar(struct pci_endpoint_test *test,static int pci_endpoint_test_bars (struct pci_endpoint_test *test) {enum pci_barno bar; -bool ret; +int ret;/* Write all BARs in order (without reading). */ for (bar =0 ; bar <PCI_STD_NUM_BARS ; bar++)
@@ -398,7 +398,7 @@ static int pci_endpoint_test_bars(struct pci_endpoint_test *test)for (bar =0 ; bar <PCI_STD_NUM_BARS ; bar++) {if (test->bar[bar]) { ret =pci_endpoint_test_bars_read_bar (test, bar); -if (!ret) +if (ret)return ret; } }
Signature · 1 line
2.48.1
Quoted 6 lines · Niklas Cassel
Commit
f26d37ee9bda("misc:pci_endpoint_test: Fix IOCTL return value") changed the return value ofpci_endpoint_test_bars_read_bar()from false to-EINVALon error, however, it failed to update the error handling.Fixes f26d37ee9bda ("misc: pci_endpoint_test: Fix IOCTL return value")Signed-off-by Niklas Cassel <[email protected]>
- Mani
Quoted 32 lines
---
Changes since v1:(quoted diff) +0
-1-Changed the type of the variable ret to int to match the new return type. drivers/misc/pci_endpoint_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/misc/pci_endpoint_test.c +2
-2@@ -382,7 +382,7 @@ static int pci_endpoint_test_bars_read_bar(struct pci_endpoint_test *test,static int pci_endpoint_test_bars (struct pci_endpoint_test *test) {enum pci_barno bar; -bool ret; +int ret;/* Write all BARs in order (without reading). */ for (bar =0 ; bar <PCI_STD_NUM_BARS ; bar++)@@ -398,7 +398,7 @@ static int pci_endpoint_test_bars(struct pci_endpoint_test *test)for (bar =0 ; bar <PCI_STD_NUM_BARS ; bar++) {if (test->bar[bar]) { ret =pci_endpoint_test_bars_read_bar (test, bar); -if (!ret) +if (ret)return ret; } }Signature · 1 line
2.48.1
Signature · 1 line
மணிவண்ணன் சதாசிவம்
Quoted 38 lines · Niklas Cassel
Commit
f26d37ee9bda("misc:pci_endpoint_test: Fix IOCTL return value") changed the return value ofpci_endpoint_test_bars_read_bar()from false to-EINVALon error, however, it failed to update the error handling.Fixes f26d37ee9bda ("misc: pci_endpoint_test: Fix IOCTL return value")Signed-off-by Niklas Cassel <[email protected]>---
Changes since v1:(quoted diff) +0
-1-Changed the type of the variable ret to int to match the new return type. drivers/misc/pci_endpoint_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/misc/pci_endpoint_test.c +2
-2@@ -382,7 +382,7 @@ static int pci_endpoint_test_bars_read_bar(struct pci_endpoint_test *test,static int pci_endpoint_test_bars (struct pci_endpoint_test *test) {enum pci_barno bar; -bool ret; +int ret;/* Write all BARs in order (without reading). */ for (bar =0 ; bar <PCI_STD_NUM_BARS ; bar++)@@ -398,7 +398,7 @@ static int pci_endpoint_test_bars(struct pci_endpoint_test *test)for (bar =0 ; bar <PCI_STD_NUM_BARS ; bar++) {if (test->bar[bar]) { ret =pci_endpoint_test_bars_read_bar (test, bar); -if (!ret) +if (ret)return ret; } }Signature · 1 line
2.48.1
Ping.
Because of this bug, if this test fails, it will be reported as success, so quite bad.
Kind regards,
Niklas
Manivannan Sadhasivam
AppliedQuoted 6 lines · Niklas Cassel
Commit
f26d37ee9bda("misc:pci_endpoint_test: Fix IOCTL return value") changed the return value ofpci_endpoint_test_bars_read_bar()from false to-EINVALon error, however, it failed to update the error handling.Fixes f26d37ee9bda ("misc: pci_endpoint_test: Fix IOCTL return value")Signed-off-by Niklas Cassel <[email protected]>
Applied to pci/endpoint!
- Mani
Quoted 32 lines
---
Changes since v1:(quoted diff) +0
-1-Changed the type of the variable ret to int to match the new return type. drivers/misc/pci_endpoint_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/misc/pci_endpoint_test.c +2
-2@@ -382,7 +382,7 @@ static int pci_endpoint_test_bars_read_bar(struct pci_endpoint_test *test,static int pci_endpoint_test_bars (struct pci_endpoint_test *test) {enum pci_barno bar; -bool ret; +int ret;/* Write all BARs in order (without reading). */ for (bar =0 ; bar <PCI_STD_NUM_BARS ; bar++)@@ -398,7 +398,7 @@ static int pci_endpoint_test_bars(struct pci_endpoint_test *test)for (bar =0 ; bar <PCI_STD_NUM_BARS ; bar++) {if (test->bar[bar]) { ret =pci_endpoint_test_bars_read_bar (test, bar); -if (!ret) +if (ret)return ret; } }Signature · 1 line
2.48.1
Signature · 1 line
மணிவண்ணன் சதாசிவம்