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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1452275287-3473-1-git-send-email-bhor.pranjal@gmail.com>
Date:	Fri,  8 Jan 2016 23:18:07 +0530
From:	Pranjal Bhor <bhor.pranjal@...il.com>
To:	gregkh@...uxfoundation.org
Cc:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	Pranjal Bhor <bhor.pranjal@...il.com>
Subject: [PATCH 6/6] drivers/staging/wlan-ng/p80211conv.c: NULL compare fixes

Elegance added to NULL comparisons.

Signed-off-by: Pranjal Bhor <bhor.pranjal@...il.com>
---
 drivers/staging/wlan-ng/p80211conv.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c
index 117dff8..f8eb861 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -562,17 +562,17 @@ void p80211skb_rxmeta_detach(struct sk_buff *skb)
	struct p80211_frmmeta *frmmeta;

	/* Sanity checks */
-	if (skb == NULL) {	/* bad skb */
+	if (!skb) {	/* bad skb */
		pr_debug("Called w/ null skb.\n");
		return;
	}
	frmmeta = P80211SKB_FRMMETA(skb);
-	if (frmmeta == NULL) {	/* no magic */
+	if (!frmmeta) {	/* no magic */
		pr_debug("Called w/ bad frmmeta magic.\n");
		return;
	}
	rxmeta = frmmeta->rx;
-	if (rxmeta == NULL) {	/* bad meta ptr */
+	if (!rxmeta) {	/* bad meta ptr */
		pr_debug("Called w/ bad rxmeta ptr.\n");
		return;
	}
@@ -608,7 +608,7 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb)
	struct p80211_frmmeta *frmmeta;

	/* If these already have metadata, we error out! */
-	if (P80211SKB_RXMETA(skb) != NULL) {
+	if (P80211SKB_RXMETA(skb)) {
		netdev_err(wlandev->netdev,
			   "%s: RXmeta already attached!\n", wlandev->name);
		result = 0;
@@ -618,7 +618,7 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb)
	/* Allocate the rxmeta */
	rxmeta = kzalloc(sizeof(struct p80211_rxmeta), GFP_ATOMIC);

-	if (rxmeta == NULL) {
+	if (!rxmeta) {
		netdev_err(wlandev->netdev,
			   "%s: Failed to allocate rxmeta.\n", wlandev->name);
		result = 1;
--
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ