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-next>] [day] [month] [year] [list]
Message-Id: <20201027214257.8099-1-martin@kaiser.cx>
Date:   Tue, 27 Oct 2020 22:42:57 +0100
From:   Martin Kaiser <martin@...ser.cx>
To:     Krzysztof Kozlowski <krzk@...nel.org>,
        Wolfram Sang <wsa@...nel.org>,
        Andrzej Hajda <a.hajda@...sung.com>
Cc:     linux-i2c@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
        linux-kernel@...r.kernel.org, Martin Kaiser <martin@...ser.cx>
Subject: [PATCH] i2c: exynos5: fix platform_get_irq error handling

platform_get_irq already prints an error message if the requested irq
was not found. Don't print another message in the driver.

If platform_get_irq returns an error, relay this error to the caller of the
probe function. Don't change all errors to -EINVAL. This breaks the case
where platform_get_irq returns -EPROBE_DEFER.

platform_get_irq never returns 0. Don't check for this. Make it clear that
the error path always returns a negative error code.

Signed-off-by: Martin Kaiser <martin@...ser.cx>
---
 drivers/i2c/busses/i2c-exynos5.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c
index 6ce3ec03b595..20a9881a0d6c 100644
--- a/drivers/i2c/busses/i2c-exynos5.c
+++ b/drivers/i2c/busses/i2c-exynos5.c
@@ -778,11 +778,8 @@ static int exynos5_i2c_probe(struct platform_device *pdev)
 	init_completion(&i2c->msg_complete);
 
 	i2c->irq = ret = platform_get_irq(pdev, 0);
-	if (ret <= 0) {
-		dev_err(&pdev->dev, "cannot find HS-I2C IRQ\n");
-		ret = -EINVAL;
+	if (ret < 0)
 		goto err_clk;
-	}
 
 	ret = devm_request_irq(&pdev->dev, i2c->irq, exynos5_i2c_irq,
 			       IRQF_NO_SUSPEND, dev_name(&pdev->dev), i2c);
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ