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: <20211207230709.121444-1-colin.i.king@gmail.com>
Date:   Tue,  7 Dec 2021 23:07:09 +0000
From:   Colin Ian King <colin.i.king@...il.com>
To:     Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org,
        Dan Carpenter <dan.carpenter@...cle.com>
Subject: [PATCH][V2] intel_th: remove redundant re-assignment of pointer hubdrv

The pointer hubdrv is being re-assigned the same value as it was
initialized with only a few lines earlier. The re-assignment is
redundant and can be removed.

As Dan Carpenter pointed out, the pointer hubdrv is hub - some_offset
and in this case some_offset is zero. Since hub has already been
dereferenced hubdrv can't be NULL so the NULL check is redundant
and can also be removed.

Signed-off-by: Colin Ian King <colin.i.king@...il.com>

---

V2: Remove null check, kudos to Dan Carpenter for spotting this.

---
 drivers/hwtracing/intel_th/core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index 7e753a75d23b..bf4ee2a31006 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -1048,8 +1048,7 @@ int intel_th_set_output(struct intel_th_device *thdev,
 	 * hub is instantiated together with the source device that
 	 * calls here, so guaranteed to be present.
 	 */
-	hubdrv = to_intel_th_driver(hub->dev.driver);
-	if (!hubdrv || !try_module_get(hubdrv->driver.owner))
+	if (!try_module_get(hubdrv->driver.owner))
 		return -EINVAL;
 
 	if (!hubdrv->set_output) {
-- 
2.33.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ