提交 d6a6ed73 编写于 作者: P Phil Elwell 提交者: Zheng Zengkai

pinctrl: bcm2835: Remove gpiochip on error

raspberrypi inclusion
category: feature
bugzilla: 50432

--------------------------------

A failure in gpiochip_irqchip_add leads to a leak of a gpiochip. Fix
the leak with the use of devm_gpiochip_add_data.

Fixes: 85ae9e51 ("pinctrl: bcm2835: switch to GPIOLIB_IRQCHIP")
Signed-off-by: NPhil Elwell <phil@raspberrypi.org>
Signed-off-by: NFang Yafen <yafen@iscas.ac.cn>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 e9d6738a
...@@ -1300,7 +1300,7 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) ...@@ -1300,7 +1300,7 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
girq->default_type = IRQ_TYPE_NONE; girq->default_type = IRQ_TYPE_NONE;
girq->handler = handle_level_irq; girq->handler = handle_level_irq;
err = gpiochip_add_data(&pc->gpio_chip, pc); err = devm_gpiochip_add_data(dev, &pc->gpio_chip, pc);
if (err) { if (err) {
dev_err(dev, "could not add GPIO chip\n"); dev_err(dev, "could not add GPIO chip\n");
return err; return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册