Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 436db5ce authored by Dan Carpenter's avatar Dan Carpenter Committed by Rafael J. Wysocki
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 73af2d59
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -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))