diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-12-24 02:23:03 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-12-27 19:29:40 -0500 |
commit | 436db5ce0d0e892d2f7327dd7ffd573c5fb9e6cb (patch) | |
tree | ba2aded9eacd34d75e92ee2b48ec408c417bb64d /drivers/acpi/acpi_dbg.c | |
parent | 73af2d590ab1b7bc7c3fc3e6933d5dcd379c9c2e (diff) |
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@oracle.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpi_dbg.c')
-rw-r--r-- | drivers/acpi/acpi_dbg.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/acpi/acpi_dbg.c b/drivers/acpi/acpi_dbg.c index fa18bd0162f4..975ccecf6215 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, | |||
610 | int ret = 0; | 610 | int ret = 0; |
611 | int size = 0; | 611 | int size = 0; |
612 | 612 | ||
613 | if (!buf || count < 0) | ||
614 | return -EINVAL; | ||
615 | if (!count) | 613 | if (!count) |
616 | return 0; | 614 | return 0; |
617 | if (!access_ok(VERIFY_WRITE, buf, count)) | 615 | if (!access_ok(VERIFY_WRITE, buf, count)) |
@@ -681,8 +679,6 @@ static ssize_t acpi_aml_write(struct file *file, const char __user *buf, | |||
681 | int ret = 0; | 679 | int ret = 0; |
682 | int size = 0; | 680 | int size = 0; |
683 | 681 | ||
684 | if (!buf || count < 0) | ||
685 | return -EINVAL; | ||
686 | if (!count) | 682 | if (!count) |
687 | return 0; | 683 | return 0; |
688 | if (!access_ok(VERIFY_READ, buf, count)) | 684 | if (!access_ok(VERIFY_READ, buf, count)) |