Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758436AbaJ3JSK (ORCPT ); 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 X-Sender-Id: pramod.gurav@smartplayin.com 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/