bcm27xx: update patches from RPi foundation
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0367-pinctrl-bcm2835-Remove-gpiochip-on-error.patch
1 From 0cddfafa817a776063ba6f00fb439d9a415235f9 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Mon, 6 Jan 2020 16:04:30 +0000
4 Subject: [PATCH] pinctrl: bcm2835: Remove gpiochip on error
5
6 A failure in gpiochip_irqchip_add leads to a leak of a gpiochip. Fix
7 the leak with the use of devm_gpiochip_add_data.
8
9 Fixes: 85ae9e512f43 ("pinctrl: bcm2835: switch to GPIOLIB_IRQCHIP")
10 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
11 ---
12 drivers/pinctrl/bcm/pinctrl-bcm2835.c | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
16 +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
17 @@ -1135,7 +1135,7 @@ static int bcm2835_pinctrl_probe(struct
18 raw_spin_lock_init(&pc->irq_lock[i]);
19 }
20
21 - err = gpiochip_add_data(&pc->gpio_chip, pc);
22 + err = devm_gpiochip_add_data(dev, &pc->gpio_chip, pc);
23 if (err) {
24 dev_err(dev, "could not add GPIO chip\n");
25 return err;