Commit 371a77da authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

PCI Hotplug Core: Add allocation sanity checks. Patch from Silvio Cesare

parent 77916a35
...@@ -621,7 +621,7 @@ static ssize_t power_write_file (struct file *file, const char *ubuff, size_t co ...@@ -621,7 +621,7 @@ static ssize_t power_write_file (struct file *file, const char *ubuff, size_t co
if (*offset < 0) if (*offset < 0)
return -EINVAL; return -EINVAL;
if (count <= 0) if (count == 0 || count > 16384)
return 0; return 0;
if (*offset != 0) if (*offset != 0)
return 0; return 0;
...@@ -732,7 +732,7 @@ static ssize_t attention_write_file (struct file *file, const char *ubuff, size_ ...@@ -732,7 +732,7 @@ static ssize_t attention_write_file (struct file *file, const char *ubuff, size_
if (*offset < 0) if (*offset < 0)
return -EINVAL; return -EINVAL;
if (count <= 0) if (count == 0 || count > 16384)
return 0; return 0;
if (*offset != 0) if (*offset != 0)
return 0; return 0;
...@@ -970,7 +970,7 @@ static ssize_t test_write_file (struct file *file, const char *ubuff, size_t cou ...@@ -970,7 +970,7 @@ static ssize_t test_write_file (struct file *file, const char *ubuff, size_t cou
if (*offset < 0) if (*offset < 0)
return -EINVAL; return -EINVAL;
if (count <= 0) if (count == 0 || count > 16384)
return 0; return 0;
if (*offset != 0) if (*offset != 0)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment