Commit 3a83f575 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq fixes from Thomas Gleixner:
 "Two small fixes for interrupt chip drivers:

   - Prevent UAF in the new RZA1 chip driver

   - Fix the wrong argument order of the GENMASK macro in the GIC code"

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  irqchip/gic-v3-its: Fix misuse of GENMASK macro
  irqchip/renesas-rza1: Prevent use-after-free in rza1_irqc_probe()
parents a131c2bf 20faba84
...@@ -185,7 +185,7 @@ static struct its_collection *dev_event_to_col(struct its_device *its_dev, ...@@ -185,7 +185,7 @@ static struct its_collection *dev_event_to_col(struct its_device *its_dev,
static struct its_collection *valid_col(struct its_collection *col) static struct its_collection *valid_col(struct its_collection *col)
{ {
if (WARN_ON_ONCE(col->target_address & GENMASK_ULL(0, 15))) if (WARN_ON_ONCE(col->target_address & GENMASK_ULL(15, 0)))
return NULL; return NULL;
return col; return col;
......
...@@ -208,20 +208,19 @@ static int rza1_irqc_probe(struct platform_device *pdev) ...@@ -208,20 +208,19 @@ static int rza1_irqc_probe(struct platform_device *pdev)
return PTR_ERR(priv->base); return PTR_ERR(priv->base);
gic_node = of_irq_find_parent(np); gic_node = of_irq_find_parent(np);
if (gic_node) { if (gic_node)
parent = irq_find_host(gic_node); parent = irq_find_host(gic_node);
of_node_put(gic_node);
}
if (!parent) { if (!parent) {
dev_err(dev, "cannot find parent domain\n"); dev_err(dev, "cannot find parent domain\n");
return -ENODEV; ret = -ENODEV;
goto out_put_node;
} }
ret = rza1_irqc_parse_map(priv, gic_node); ret = rza1_irqc_parse_map(priv, gic_node);
if (ret) { if (ret) {
dev_err(dev, "cannot parse %s: %d\n", "interrupt-map", ret); dev_err(dev, "cannot parse %s: %d\n", "interrupt-map", ret);
return ret; goto out_put_node;
} }
priv->chip.name = "rza1-irqc", priv->chip.name = "rza1-irqc",
...@@ -237,10 +236,12 @@ static int rza1_irqc_probe(struct platform_device *pdev) ...@@ -237,10 +236,12 @@ static int rza1_irqc_probe(struct platform_device *pdev)
priv); priv);
if (!priv->irq_domain) { if (!priv->irq_domain) {
dev_err(dev, "cannot initialize irq domain\n"); dev_err(dev, "cannot initialize irq domain\n");
return -ENOMEM; ret = -ENOMEM;
} }
return 0; out_put_node:
of_node_put(gic_node);
return ret;
} }
static int rza1_irqc_remove(struct platform_device *pdev) static int rza1_irqc_remove(struct platform_device *pdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment