Commit c11aadb9 authored by Arvind Yadav's avatar Arvind Yadav Committed by Greg Kroah-Hartman

power: reset: hisi-reboot: Unmap region obtained by of_iomap

commit bae170ef upstream.

Free memory mapping, if probe is not successful.

Fixes: 4a9b3737 ("power: reset: move hisilicon reboot code")
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1c79cde5
...@@ -53,13 +53,16 @@ static int hisi_reboot_probe(struct platform_device *pdev) ...@@ -53,13 +53,16 @@ static int hisi_reboot_probe(struct platform_device *pdev)
if (of_property_read_u32(np, "reboot-offset", &reboot_offset) < 0) { if (of_property_read_u32(np, "reboot-offset", &reboot_offset) < 0) {
pr_err("failed to find reboot-offset property\n"); pr_err("failed to find reboot-offset property\n");
iounmap(base);
return -EINVAL; return -EINVAL;
} }
err = register_restart_handler(&hisi_restart_nb); err = register_restart_handler(&hisi_restart_nb);
if (err) if (err) {
dev_err(&pdev->dev, "cannot register restart handler (err=%d)\n", dev_err(&pdev->dev, "cannot register restart handler (err=%d)\n",
err); err);
iounmap(base);
}
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment