lkml.org 
[lkml]   [2012]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[V2 PATCH 2/3] staging: ozwpan: Remove redundant null check before kfree in ozproto.c
Date
Free memory if timer pool count > OZ_MAX_TIMER_POOL_SIZE

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
---
drivers/staging/ozwpan/ozproto.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/ozwpan/ozproto.c b/drivers/staging/ozwpan/ozproto.c
index cfb5160..832fde1 100644
--- a/drivers/staging/ozwpan/ozproto.c
+++ b/drivers/staging/ozwpan/ozproto.c
@@ -552,8 +552,8 @@ static void oz_protocol_timer(unsigned long arg)
t->link.next = g_timer_pool;
g_timer_pool = &t->link;
g_timer_pool_count++;
- t = 0;
- }
+ } else
+ kfree(t);
if (!list_empty(&g_timer_list)) {
t2 = container_of(g_timer_list.next,
struct oz_timer, link);
@@ -566,8 +566,6 @@ static void oz_protocol_timer(unsigned long arg)
}
spin_unlock_bh(&g_polling_lock);
oz_pd_put(pd);
- if (t)
- kfree(t);
t = t2;
} while (t);
g_timer_state = OZ_TIMER_IDLE;
--
1.7.5.4



\
 
 \ /
  Last update: 2012-11-21 14:41    [W:0.025 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site