Skip to content

Commit

Permalink
ACPI / debugger: remove some unneeded conditions
Browse files Browse the repository at this point in the history
"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@oracle.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Dan Carpenter authored and Rafael J. Wysocki committed Dec 28, 2015
1 parent 73af2d5 commit 436db5c
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/acpi/acpi_dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 436db5c

Please sign in to comment.