Skip to content

Commit b547b5e

Browse files
tititiou36Bartosz Golaszewski
authored andcommitted
gpio: tb10x: Fix an error handling path in tb10x_gpio_probe()
If an error occurs after a successful irq_domain_add_linear() call, it should be undone by a corresponding irq_domain_remove(), as already done in the remove function. Fixes: c6ce2b6 ("gpio: add TB10x GPIO driver") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 2d48c30 commit b547b5e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/gpio/gpio-tb10x.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
195195
handle_edge_irq, IRQ_NOREQUEST, IRQ_NOPROBE,
196196
IRQ_GC_INIT_MASK_CACHE);
197197
if (ret)
198-
return ret;
198+
goto err_remove_domain;
199199

200200
gc = tb10x_gpio->domain->gc->gc[0];
201201
gc->reg_base = tb10x_gpio->base;
@@ -209,6 +209,10 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
209209
}
210210

211211
return 0;
212+
213+
err_remove_domain:
214+
irq_domain_remove(tb10x_gpio->domain);
215+
return ret;
212216
}
213217

214218
static int tb10x_gpio_remove(struct platform_device *pdev)

0 commit comments

Comments
 (0)