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: <20151224072303.GA29642@mwanda>
Date:	Thu, 24 Dec 2015 10:23:03 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Lv Zheng <lv.zheng@...el.com>
Cc:	Len Brown <lenb@...nel.org>, linux-acpi@...r.kernel.org,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [patch 1/2] ACPI / debugger: remove some unneeded conditions

"count" is unsigned so checking for less than zero here causes a static
checker warning.  And really it's better to let the access_ok() check
fail if the user passes in a NULL "buf" pointer because -EFAULT is the
correct error code.

Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>

diff --git a/drivers/acpi/acpi_dbg.c b/drivers/acpi/acpi_dbg.c
index 381beb2..f2c92ab 100644
--- a/drivers/acpi/acpi_dbg.c
+++ b/drivers/acpi/acpi_dbg.c
@@ -610,8 +610,6 @@ static ssize_t acpi_aml_read(struct file *file, char __user *buf,
 	int ret = 0;
 	int size = 0;
 
-	if (!buf || count < 0)
-		return -EINVAL;
 	if (!count)
 		return 0;
 	if (!access_ok(VERIFY_WRITE, buf, count))
@@ -681,8 +679,6 @@ static ssize_t acpi_aml_write(struct file *file, const char __user *buf,
 	int ret = 0;
 	int size = 0;
 
-	if (!buf || count < 0)
-		return -EINVAL;
 	if (!count)
 		return 0;
 	if (!access_ok(VERIFY_READ, buf, count))
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ