From patchwork Sun Jul 11 22:09:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tarun Kanti DebBarma X-Patchwork-Id: 111306 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6BBCTXL007920 for ; Sun, 11 Jul 2010 11:12:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753875Ab0GKLMX (ORCPT ); Sun, 11 Jul 2010 07:12:23 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:40923 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753784Ab0GKLMX (ORCPT ); Sun, 11 Jul 2010 07:12:23 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id o6BBCKu7010225 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 11 Jul 2010 06:12:22 -0500 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id o6BBCEDj014490; Sun, 11 Jul 2010 16:42:14 +0530 (IST) From: Tarun Kanti DebBarma To: olbpdev@list.ti.com Cc: linux-omap@vger.kernel.org, Tarun Kanti Debbarma Subject: [PATCH]omap:dmtimer:no null check for kzalloc Date: Mon, 12 Jul 2010 03:39:45 +0530 Message-Id: <1278886185-12502-1-git-send-email-tarun.kanti@ti.com> X-Mailer: git-send-email 1.6.0.4 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 11 Jul 2010 11:12:29 +0000 (UTC) diff --git a/arch/arm/mach-omap2/dmtimers.c b/arch/arm/mach-omap2/dmtimers.c index 772be63..a7e9ac5 100644 --- a/arch/arm/mach-omap2/dmtimers.c +++ b/arch/arm/mach-omap2/dmtimers.c @@ -248,7 +248,12 @@ void __init omap2_dm_timer_early_init(void) pdata = kzalloc(sizeof(struct omap_dm_timer_plat_info), GFP_KERNEL); - + if (!pdata) { + pr_err("%s: \ + No memory for omap_dm_timer_plat_info\n", + __func__); + return -ENOMEM; + } pdata->omap_dm_clk_enable = omap2_dm_timer_enable; pdata->omap_dm_clk_disable = omap2_dm_timer_disable; pdata->omap_dm_set_source_clk = omap2_dm_timer_set_clk; @@ -346,6 +351,12 @@ int __init omap2_dm_timer_init(void) pdata = kzalloc(sizeof(struct omap_dm_timer_plat_info), GFP_KERNEL); + if (!pdata) { + pr_err("%s: \ + No memory for omap_dm_timer_plat_info\n", + __func__); + return -ENOMEM; + } pdata->omap_dm_clk_enable = omap2_dm_timer_enable; pdata->omap_dm_clk_disable = omap2_dm_timer_disable; pdata->omap_dm_set_source_clk = omap2_dm_timer_set_clk; @@ -397,7 +408,12 @@ fail: break; pdata = kzalloc(sizeof(struct omap_dm_timer_plat_info), GFP_KERNEL); - + if (!pdata) { + pr_err("%s: \ + No memory for omap_dm_timer_plat_info\n", + __func__); + return -ENOMEM; + } pdata->omap_dm_clk_enable = omap2_dm_timer_enable; pdata->omap_dm_clk_disable = omap2_dm_timer_disable; pdata->omap_dm_set_source_clk = omap2_dm_timer_set_clk;