lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a55409b0-9839-d9b5-5c90-606c22d0c58b@users.sourceforge.net>
Date:   Thu, 2 Nov 2017 14:00:10 +0100
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-pci@...r.kernel.org, linux-renesas-soc@...r.kernel.org,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        Simon Horman <horms@...ge.net.au>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH v2] PCI: rcar: Use common error handling code in
 rcar_pcie_enable_msi()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 2 Nov 2017 13:35:17 +0100

* Adjust a jump target so that a specific error message is stored only once
  at the end of this function implementation.

* Replace two calls of the function "dev_err" by goto statements.

This issue was detected by using the Coccinelle software.

Link: https://lkml.org/lkml/2017/11/2/140
Link: https://lkml.kernel.org/r/<20171102081239.bzaunax3uotejqja@...ge.net.au>
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---

v2:
An other jump label was requested by Simon Horman.

 drivers/pci/host/pcie-rcar.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index 12796eccb2be..f3c1ffdf8072 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -873,18 +873,14 @@ static int rcar_pcie_enable_msi(struct rcar_pcie *pcie)
 	err = devm_request_irq(dev, msi->irq1, rcar_pcie_msi_irq,
 			       IRQF_SHARED | IRQF_NO_THREAD,
 			       rcar_msi_irq_chip.name, pcie);
-	if (err < 0) {
-		dev_err(dev, "failed to request IRQ: %d\n", err);
-		goto err;
-	}
+	if (err < 0)
+		goto err_remove_domain;
 
 	err = devm_request_irq(dev, msi->irq2, rcar_pcie_msi_irq,
 			       IRQF_SHARED | IRQF_NO_THREAD,
 			       rcar_msi_irq_chip.name, pcie);
-	if (err < 0) {
-		dev_err(dev, "failed to request IRQ: %d\n", err);
-		goto err;
-	}
+	if (err < 0)
+		goto err_remove_domain;
 
 	/* setup MSI data target */
 	msi->pages = __get_free_pages(GFP_KERNEL, 0);
@@ -898,7 +894,8 @@ static int rcar_pcie_enable_msi(struct rcar_pcie *pcie)
 
 	return 0;
 
-err:
+err_remove_domain:
+	dev_err(dev, "failed to request IRQ: %d\n", err);
 	irq_domain_remove(msi->domain);
 	return err;
 }
-- 
2.15.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ