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>] [day] [month] [year] [list]
Message-ID: <20220318100344.4030432-1-zouyue3@huawei.com>
Date:   Fri, 18 Mar 2022 10:03:44 +0000
From:   Yue Zou <zouyue3@...wei.com>
To:     <stuyoder@...il.com>, <laurentiu.tudor@....com>
CC:     <linux-kernel@...r.kernel.org>
Subject: [PATCH -next] bus: fsl-mc: simplify DPMCP version check

The minimum supported DPMCP version is 3.0, and the second
half of version check is always false due to the limited range
of minor version's unsigned data type. Just remove the second
check to simplify the condition.

Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Yue Zou <zouyue3@...wei.com>
---
 drivers/bus/fsl-mc/mc-io.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/bus/fsl-mc/mc-io.c b/drivers/bus/fsl-mc/mc-io.c
index 95b10a6cf307..f6a8b3b9ba3c 100644
--- a/drivers/bus/fsl-mc/mc-io.c
+++ b/drivers/bus/fsl-mc/mc-io.c
@@ -193,9 +193,7 @@ int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev,
 	error = -EINVAL;
 	dpmcp_dev = resource->data;
 
-	if (dpmcp_dev->obj_desc.ver_major < DPMCP_MIN_VER_MAJOR ||
-	    (dpmcp_dev->obj_desc.ver_major == DPMCP_MIN_VER_MAJOR &&
-	     dpmcp_dev->obj_desc.ver_minor < DPMCP_MIN_VER_MINOR)) {
+	if (dpmcp_dev->obj_desc.ver_major < DPMCP_MIN_VER_MAJOR) {
 		dev_err(&dpmcp_dev->dev,
 			"ERROR: Version %d.%d of DPMCP not supported.\n",
 			dpmcp_dev->obj_desc.ver_major,
-- 
2.18.0.huawei.25

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ