projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
9cb1fd0
)
Merge remote-tracking branch 'regmap/for-5.7' into regmap-linus
author
Mark Brown
<broonie@kernel.org>
Fri, 29 May 2020 13:03:30 +0000
(14:03 +0100)
committer
Mark Brown
<broonie@kernel.org>
Fri, 29 May 2020 13:03:30 +0000
(14:03 +0100)
drivers/base/regmap/regmap-debugfs.c
patch
|
blob
|
history
diff --git
a/drivers/base/regmap/regmap-debugfs.c
b/drivers/base/regmap/regmap-debugfs.c
index
e72843f
..
089e5dc
100644
(file)
--- a/
drivers/base/regmap/regmap-debugfs.c
+++ b/
drivers/base/regmap/regmap-debugfs.c
@@
-227,6
+227,9
@@
static ssize_t regmap_read_debugfs(struct regmap *map, unsigned int from,
if (*ppos < 0 || !count)
return -EINVAL;
+ if (count > (PAGE_SIZE << (MAX_ORDER - 1)))
+ count = PAGE_SIZE << (MAX_ORDER - 1);
+
buf = kmalloc(count, GFP_KERNEL);
if (!buf)
return -ENOMEM;
@@
-371,6
+374,9
@@
static ssize_t regmap_reg_ranges_read_file(struct file *file,
if (*ppos < 0 || !count)
return -EINVAL;
+ if (count > (PAGE_SIZE << (MAX_ORDER - 1)))
+ count = PAGE_SIZE << (MAX_ORDER - 1);
+
buf = kmalloc(count, GFP_KERNEL);
if (!buf)
return -ENOMEM;