power: reset: xgene-reboot: Unmap region obtained by of_iomap
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Wed, 14 Sep 2016 10:55:39 +0000 (16:25 +0530)
committerSebastian Reichel <sre@kernel.org>
Mon, 19 Sep 2016 19:24:06 +0000 (21:24 +0200)
Free memory mapping, if probe is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/reset/xgene-reboot.c

index f07e93c97ba337624d202b19b55ab46fda170b21..73c3d93e5318b9ab2c7d6287c01e4a8b83d8de5e 100644 (file)
@@ -81,8 +81,10 @@ static int xgene_reboot_probe(struct platform_device *pdev)
        ctx->restart_handler.notifier_call = xgene_restart_handler;
        ctx->restart_handler.priority = 128;
        err = register_restart_handler(&ctx->restart_handler);
-       if (err)
+       if (err) {
+               iounmap(ctx->csr);
                dev_err(dev, "cannot register restart handler (err=%d)\n", err);
+       }
 
        return err;
 }