* Re: [PATCH]omap:dmtimer:no null check for kzalloc
2010-07-11 22:09 [PATCH]omap:dmtimer:no null check for kzalloc Tarun Kanti DebBarma
@ 2010-07-11 18:02 ` Artem Bityutskiy
2010-07-12 3:39 ` DebBarma, Tarun Kanti
0 siblings, 1 reply; 3+ messages in thread
From: Artem Bityutskiy @ 2010-07-11 18:02 UTC (permalink / raw)
To: Tarun Kanti DebBarma; +Cc: olbpdev, linux-omap
On Mon, 2010-07-12 at 03:39 +0530, Tarun Kanti DebBarma wrote:
> + if (!pdata) {
> + pr_err("%s: \
> + No memory for omap_dm_timer_plat_info\n",
> + __func__);
> + return -ENOMEM;
> + }
do not use concatenation ('\'), this is probably not what you want.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH]omap:dmtimer:no null check for kzalloc
@ 2010-07-11 22:09 Tarun Kanti DebBarma
2010-07-11 18:02 ` Artem Bityutskiy
0 siblings, 1 reply; 3+ messages in thread
From: Tarun Kanti DebBarma @ 2010-07-11 22:09 UTC (permalink / raw)
To: olbpdev; +Cc: linux-omap, Tarun Kanti Debbarma
This patch incorporates null pointer check associated with memory allocation
for omap_dm_timer_plat_info using kzalloc()
Tested on OMAP4430 SDP.
Signed-off-by: Tarun Kanti Debbarma <tarun.kanti@ti.com>
---
arch/arm/mach-omap2/dmtimers.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
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;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH]omap:dmtimer:no null check for kzalloc
2010-07-11 18:02 ` Artem Bityutskiy
@ 2010-07-12 3:39 ` DebBarma, Tarun Kanti
0 siblings, 0 replies; 3+ messages in thread
From: DebBarma, Tarun Kanti @ 2010-07-12 3:39 UTC (permalink / raw)
To: dedekind1
Cc: olbpdev@list.ti.com - OMAP Linux Baseport Development Team (May
contain non-TIers),
linux-omap
> -----Original Message-----
> From: Artem Bityutskiy [mailto:dedekind1@gmail.com]
> Sent: Sunday, July 11, 2010 11:33 PM
> To: DebBarma, Tarun Kanti
> Cc: olbpdev@list.ti.com - OMAP Linux Baseport Development Team (May
> contain non-TIers); linux-omap@vger.kernel.org
> Subject: Re: [PATCH]omap:dmtimer:no null check for kzalloc
>
> On Mon, 2010-07-12 at 03:39 +0530, Tarun Kanti DebBarma wrote:
> > + if (!pdata) {
> > + pr_err("%s: \
> > + No memory for
> omap_dm_timer_plat_info\n",
> > + __func__);
> > + return -ENOMEM;
> > + }
>
> do not use concatenation ('\'), this is probably not what you want.
>
Oops! Thanks for pointing this out. I will change.
> --
> Best Regards,
> Artem Bityutskiy (Артём Битюцкий)
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-12 3:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-11 22:09 [PATCH]omap:dmtimer:no null check for kzalloc Tarun Kanti DebBarma
2010-07-11 18:02 ` Artem Bityutskiy
2010-07-12 3:39 ` DebBarma, Tarun Kanti
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.