The patch titled drivers/gpio/ml_ioh_gpio.c: fix resource leak has been removed from the -mm tree. Its filename was gpio-ml_ioh_gpio-ml7213-gpio-driver-fix.patch This patch was dropped because it was folded into gpio-ml_ioh_gpio-ml7213-gpio-driver.patch The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: drivers/gpio/ml_ioh_gpio.c: fix resource leak From: Tomoya MORINAGA <tomoya-linux@xxxxxxxxxxxxxxx> - add gpiochip_remove processing in case gpiochip_add fails. - for readability, move variable initialization to outside for-condition. Signed-off-by: Tomoya MORINAGA <tomoya-linux@xxxxxxxxxxxxxxx> Reported-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Samuel Ortiz <sameo@xxxxxxxxxxxxxxx> Cc: Rabin Vincent <rabin.vincent@xxxxxxxxxxxxxx> Cc: Marc Zyngier <maz@xxxxxxxxxxxxxxx> Cc: Linus Walleij <linus.walleij@xxxxxxxxxxxxxx> Cc: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/gpio/ml_ioh_gpio.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff -puN drivers/gpio/ml_ioh_gpio.c~gpio-ml_ioh_gpio-ml7213-gpio-driver-fix drivers/gpio/ml_ioh_gpio.c --- a/drivers/gpio/ml_ioh_gpio.c~gpio-ml_ioh_gpio-ml7213-gpio-driver-fix +++ a/drivers/gpio/ml_ioh_gpio.c @@ -208,7 +208,8 @@ static int __devinit ioh_gpio_probe(stru goto err_kzalloc; } - for (i = 0, chip = chip_save; i < 8; i++, chip++) { + chip = chip_save; + for (i = 0; i < 8; i++, chip++) { chip->dev = &pdev->dev; chip->base = base; chip->reg = chip->base; @@ -228,6 +229,12 @@ static int __devinit ioh_gpio_probe(stru return 0; err_gpiochip_add: + for (; i != 0; i--) { + chip--; + ret = gpiochip_remove(&chip->gpio); + if (ret) + dev_err(&pdev->dev, "Failed gpiochip_remove(%d)\n", i); + } kfree(chip_save); err_kzalloc: _ Patches currently in -mm which might be from tomoya-linux@xxxxxxxxxxxxxxx are origin.patch gpio-ml_ioh_gpio-ml7213-gpio-driver.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html