diff options
author | Mark Brown <broonie@kernel.org> | 2020-05-29 16:03:30 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-05-29 16:03:30 +0300 |
commit | 4bcc6a0bc8d75c1d9f9c4b7c3acfb7a210321b74 (patch) | |
tree | 346c462d8a6855c000fe234a06476177412fe8ca /drivers/base | |
parent | 9cb1fd0efd195590b828b9b865421ad345a4a145 (diff) | |
parent | 74edd08a4fbf51d65fd8f4c7d8289cd0f392bd91 (diff) | |
download | linux-4bcc6a0bc8d75c1d9f9c4b7c3acfb7a210321b74.tar.xz |
Merge remote-tracking branch 'regmap/for-5.7' into regmap-linus
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/regmap/regmap-debugfs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index e72843fe41df..089e5dc7144a 100644 --- 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; |