提交 51385858 编写于 作者: V Varka Bhadram 提交者: Linus Walleij

gpio-amd8111: add release_region on ioport_map failure

Commit ffe4770b ("gpio-amd8111: check ioport_map return value")
adds the error check on ioport_map(). It doesnt release the requested region.

On failure this patch release the region that has requested before.
Signed-off-by: NVarka Bhadram <varkab@cdac.in>
Reported-by: NAlexandre Courbot <gnurou@gmail.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 a0b66e3f
......@@ -215,6 +215,7 @@ static int __init amd_gpio_init(void)
gp.pm = ioport_map(gp.pmbase + PMBASE_OFFSET, PMBASE_SIZE);
if (!gp.pm) {
dev_err(&pdev->dev, "Couldn't map io port into io memory\n");
release_region(gp.pmbase + PMBASE_OFFSET, PMBASE_SIZE);
err = -ENOMEM;
goto out;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册