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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 27 Sep 2016 10:38:23 +0300
From:   Yannis Damigos <giannis.damigos@...il.com>
To:     gregkh@...uxfoundation.org
Cc:     markus.boehme@...lbox.org, arve@...roid.com, riandrews@...roid.com,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
        Yannis Damigos <giannis.damigos@...il.com>
Subject: [PATCHv4 1/4] staging:android:ion: Fix comparison with NULL

This patch fixes the following comparison with NULL issues:

CHECK: Comparison to NULL could be written "compatible[i].name"
+	for (i = 0; compatible[i].name != NULL; i++) {

CHECK: Comparison to NULL could be written "!compatible[i].name"
+	if (compatible[i].name == NULL)

Signed-off-by: Yannis Damigos <giannis.damigos@...il.com>
---
 drivers/staging/android/ion/ion_of.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/ion/ion_of.c b/drivers/staging/android/ion/ion_of.c
index 826e756..a8050c6 100644
--- a/drivers/staging/android/ion/ion_of.c
+++ b/drivers/staging/android/ion/ion_of.c
@@ -31,12 +31,12 @@ static int ion_parse_dt_heap_common(struct device_node *heap_node,
 {
 	int i;
 
-	for (i = 0; compatible[i].name != NULL; i++) {
+	for (i = 0; compatible[i].name; i++) {
 		if (of_device_is_compatible(heap_node, compatible[i].compat))
 			break;
 	}
 
-	if (compatible[i].name == NULL)
+	if (!compatible[i].name)
 		return -ENODEV;
 
 	heap->id = compatible[i].heap_id;
-- 
2.10.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ