If pci_enable_device() fails then we can return directly.

Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk>
---

I saw there is some pending dgnc patch in outreachy, so this series
might not apply. This series is based on staging-testing.
I will resend v2 if it fails.

 drivers/staging/dgnc/dgnc_driver.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index fc6d298..c32f208 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -283,13 +283,13 @@ static int dgnc_init_one(struct pci_dev *pdev, const 
struct pci_device_id *ent)
        /* wake up and enable device */
        rc = pci_enable_device(pdev);
 
-       if (rc < 0) {
-               rc = -EIO;
-       } else {
-               rc = dgnc_found_board(pdev, ent->driver_data);
-               if (rc == 0)
-                       dgnc_NumBoards++;
-       }
+       if (rc)
+               return -EIO;
+
+       rc = dgnc_found_board(pdev, ent->driver_data);
+       if (rc == 0)
+               dgnc_NumBoards++;
+
        return rc;
 }
 
-- 
1.9.1

Reply via email to