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]
Message-ID: <89ec267f-cae0-66b2-bcd7-27d786af3a5f@users.sourceforge.net>
Date:   Mon, 24 Apr 2017 22:18:57 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-iio@...r.kernel.org, linux-input@...r.kernel.org,
        Benjamin Tissoires <benjamin.tissoires@...hat.com>,
        Bruno Prémont <bonbons@...ux-vserver.org>,
        Henrik Rydberg <rydberg@...math.org>,
        Jiri Kosina <jikos@...nel.org>,
        Jonathan Cameron <jic23@...nel.org>,
        Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 3/7] HID: sensor-hub: Adjust two checks for null pointers in
 sensor_hub_probe()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 24 Apr 2017 20:00:06 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The script “checkpatch.pl” pointed information out like the following.

Comparison to NULL could be written !…

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/hid/hid-sensor-hub.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index feb4bb8ee3ec..4eadaef19e6a 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -675,7 +675,7 @@ static int sensor_hub_probe(struct hid_device *hdev,
 			       dev_cnt,
 			       sizeof(*sd->hid_sensor_hub_client_devs),
 			       GFP_KERNEL);
-	if (sd->hid_sensor_hub_client_devs == NULL) {
+	if (!sd->hid_sensor_hub_client_devs) {
 		ret = -ENOMEM;
 		goto err_stop_hw;
 	}
@@ -711,7 +711,7 @@ static int sensor_hub_probe(struct hid_device *hdev,
 			name = devm_kasprintf(&hdev->dev, GFP_KERNEL,
 					      "HID-SENSOR-%x",
 					      collection->usage);
-			if (name == NULL) {
+			if (!name) {
 				hid_err(hdev, "Failed MFD device name\n");
 				ret = -ENOMEM;
 				goto err_stop_hw;
-- 
2.12.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ