lkml.org 
[lkml]   [2015]   [Dec]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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@oracle.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))

\
 
 \ /
  Last update: 2015-12-24 08:41    [W:0.027 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site