From patchwork Thu Oct 30 09:21:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pramod Gurav X-Patchwork-Id: 39812 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 09D3824046 for ; Thu, 30 Oct 2014 09:18:17 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id ex7sf2906138wid.4 for ; Thu, 30 Oct 2014 02:18:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=79vEbYlTnHLxMI85J5qA08BOoRhLjCw97iZ2ss2shVE=; b=YehRNJU1Gu7tSUGKmIFex7/Lf1lEN+ERQHc+KlkR30m7T6poYzQy8EfuzIFe7VXV0P 0N+mKLv1lxVLSRrTN6gOgADxBz45NKavviFhMDsD7c3DtXdUFCKi7j61pgvq5RfFW9NF uc0g2OIpp18GWCWwLWzTQqwtll9xM33x78JF9Y+LFuwfA/esUqd7WQfuxVv/4WCKv2qf +Nwh7AuX6pY9N90x1US19aZ5t2kcL4+GVb1p4DJh8221rWyTVDkohxbpsUCYvvB5B7wG Jqmc5J5Z2eQ/ZSHZLQlDv0kp3+Sp5F0LpRvK4THQ4wLd62bCSt3PqGqdcQNFrHam22iL AClw== X-Gm-Message-State: ALoCoQktr8TrbULhUVeWej62d7S7GZ7kw2m9SBRrUINFf/tPOJHK9FQ0HQrgd6tgB10+lByBEHO3 X-Received: by 10.180.98.165 with SMTP id ej5mr342220wib.1.1414660697221; Thu, 30 Oct 2014 02:18:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.137 with SMTP id z9ls50272laa.50.gmail; Thu, 30 Oct 2014 02:18:17 -0700 (PDT) X-Received: by 10.112.182.1 with SMTP id ea1mr17203128lbc.16.1414660696992; Thu, 30 Oct 2014 02:18:16 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id ms6si11115918lbb.19.2014.10.30.02.18.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 Oct 2014 02:18:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id gq15so4079023lab.35 for ; Thu, 30 Oct 2014 02:18:16 -0700 (PDT) X-Received: by 10.152.5.38 with SMTP id p6mr17233498lap.44.1414660696362; Thu, 30 Oct 2014 02:18:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp8807lbz; Thu, 30 Oct 2014 02:18:15 -0700 (PDT) X-Received: by 10.68.101.131 with SMTP id fg3mr16115557pbb.130.1414660694481; Thu, 30 Oct 2014 02:18:14 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nz9si6127768pbb.86.2014.10.30.02.18.13 for ; Thu, 30 Oct 2014 02:18:14 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758438AbaJ3JSK (ORCPT + 26 others); Thu, 30 Oct 2014 05:18:10 -0400 Received: from smtp81.ord1c.emailsrvr.com ([108.166.43.81]:60853 "EHLO smtp81.ord1c.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758159AbaJ3JSG (ORCPT ); Thu, 30 Oct 2014 05:18:06 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp3.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 2D4CC1801C3; Thu, 30 Oct 2014 05:18:05 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp3.relay.ord1c.emailsrvr.com (Authenticated sender: pramod.gurav-AT-smartplayin.com) with ESMTPSA id 5F4571802E8; Thu, 30 Oct 2014 05:18:03 -0400 (EDT) X-Sender-Id: pramod.gurav@smartplayin.com Received: from SPINITLTDL00278.smartplayin.local ([UNAVAILABLE]. [220.227.185.53]) (using TLSv1.1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:465 (trex/5.3.2); Thu, 30 Oct 2014 09:18:05 GMT From: Pramod Gurav To: linux-kernel@vger.kernel.org Cc: Pramod Gurav , Linus Walleij , Samuel Ortiz , Lee Jones Subject: [PATCH] mfd: db8500-prcmu: check return of devm_ioremap for error Date: Thu, 30 Oct 2014 14:51:35 +0530 Message-Id: <1414660895-29255-1-git-send-email-pramod.gurav@smartplayin.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pramod.gurav@smartplayin.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Error check around return value of devm_ioremap is missing. Add the same to avoid NULL pointer dereference. Cc: Linus Walleij Cc: Samuel Ortiz Cc: Lee Jones Signed-off-by: Pramod Gurav Acked-by: Linus Walleij --- drivers/mfd/db8500-prcmu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 193cf16..89ae8bf 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -3167,6 +3167,11 @@ static int db8500_prcmu_probe(struct platform_device *pdev) } tcdm_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + if (!tcdm_base) { + dev_err(&pdev->dev, + "failed to ioremap prcmu-tcdm register memory\n"); + return -ENOENT; + } /* Clean up the mailbox interrupts after pre-kernel code. */ writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR);