Skip to content

Commit 147178c

Browse files
Sergey Shtylyovwsakernel
authored andcommitted
i2c: rcar: add IRQ check
The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to devm_request_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original error code. Stop calling devm_request_irq() with the invalid IRQ #s. Fixes: 6ccbe60 ("i2c: add Renesas R-Car I2C driver") Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent 0d3bf53 commit 147178c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎drivers/i2c/busses/i2c-rcar.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,10 @@ static int rcar_i2c_probe(struct platform_device *pdev)
10991099
if (of_property_read_bool(dev->of_node, "smbus"))
11001100
priv->flags |= ID_P_HOST_NOTIFY;
11011101

1102-
priv->irq = platform_get_irq(pdev, 0);
1102+
ret = platform_get_irq(pdev, 0);
1103+
if (ret < 0)
1104+
goto out_pm_disable;
1105+
priv->irq = ret;
11031106
ret = devm_request_irq(dev, priv->irq, irqhandler, irqflags, dev_name(dev), priv);
11041107
if (ret < 0) {
11051108
dev_err(dev, "cannot get irq %d\n", priv->irq);

0 commit comments

Comments
 (0)