lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1353501977-6585-3-git-send-email-rgujare@ozmodevices.com>
Date:	Wed, 21 Nov 2012 12:46:16 +0000
From:	Rupesh Gujare <rgujare@...odevices.com>
To:	<devel@...verdev.osuosl.org>
CC:	<linux-kernel@...r.kernel.org>, <gregkh@...uxfoundation.org>,
	<sachin.kamat@...aro.org>
Subject: [V2 PATCH 2/3] staging: ozwpan: Remove redundant null check before kfree in ozproto.c

Free memory if timer pool count > OZ_MAX_TIMER_POOL_SIZE

Signed-off-by: Sachin Kamat <sachin.kamat@...aro.org>
Signed-off-by: Rupesh Gujare <rgujare@...odevices.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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ