@@ -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;