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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1353501977-6585-2-git-send-email-rgujare@ozmodevices.com>
Date:	Wed, 21 Nov 2012 12:46:15 +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 1/3] staging: ozwpan: Remove redundant null check before kfree in ozpd.c

Call kfree only if required else return from function.

Signed-off-by: Sachin Kamat <sachin.kamat@...aro.org>
Signed-off-by: Rupesh Gujare <rgujare@...odevices.com>
---
 drivers/staging/ozwpan/ozpd.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c
index 0b3648c..1dd8980 100644
--- a/drivers/staging/ozwpan/ozpd.c
+++ b/drivers/staging/ozwpan/ozpd.c
@@ -399,11 +399,11 @@ static void oz_tx_frame_free(struct oz_pd *pd, struct oz_tx_frame *f)
 		f->link.next = pd->tx_pool;
 		pd->tx_pool = &f->link;
 		pd->tx_pool_count++;
-		f = 0;
+		spin_unlock_bh(&pd->tx_frame_lock);
+		return;
 	}
 	spin_unlock_bh(&pd->tx_frame_lock);
-	if (f)
-		kfree(f);
+	kfree(f);
 }
 /*------------------------------------------------------------------------------
  * Context: softirq-serialized
-- 
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