From patchwork Fri Aug 12 15:19:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9277313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0AA9360780 for ; Fri, 12 Aug 2016 15:42:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F01C028A60 for ; Fri, 12 Aug 2016 15:42:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4B7C28A63; Fri, 12 Aug 2016 15:42:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 892DC28A60 for ; Fri, 12 Aug 2016 15:42:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752433AbcHLP3o (ORCPT ); Fri, 12 Aug 2016 11:29:44 -0400 Received: from broadband.actcorp.in ([106.51.130.53]:38831 "EHLO arvind-ThinkPad-Edge-E431" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752441AbcHLP3n (ORCPT ); Fri, 12 Aug 2016 11:29:43 -0400 X-Greylist: delayed 606 seconds by postgrey-1.27 at vger.kernel.org; Fri, 12 Aug 2016 11:29:42 EDT Received: by arvind-ThinkPad-Edge-E431 (Postfix, from userid 1000) id B1A1C4E3047; Fri, 12 Aug 2016 20:49:20 +0530 (IST) From: Arvind Yadav To: sre@kernel.org, dbaryshkov@gmail.com, dwmw2@infradead.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Arvind Yadav Subject: [v.1] power:reset:hisi-reboot :- Unmap a region obtained by remap. Date: Fri, 12 Aug 2016 20:49:18 +0530 Message-Id: <1471015158-6132-1-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP iounmap frees the mapping when failed to find reboot-offset property and cannot register restart handler. Signed-off-by: Arvind Yadav --- drivers/power/reset/hisi-reboot.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/power/reset/hisi-reboot.c b/drivers/power/reset/hisi-reboot.c index 9ab7f56..f69387e 100644 --- a/drivers/power/reset/hisi-reboot.c +++ b/drivers/power/reset/hisi-reboot.c @@ -53,13 +53,16 @@ static int hisi_reboot_probe(struct platform_device *pdev) if (of_property_read_u32(np, "reboot-offset", &reboot_offset) < 0) { pr_err("failed to find reboot-offset property\n"); + iounmap(base); return -EINVAL; } err = register_restart_handler(&hisi_restart_nb); - if (err) + if (err) { dev_err(&pdev->dev, "cannot register restart handler (err=%d)\n", err); + iounmap(base); + } return err; }