aboutsummaryrefslogtreecommitdiff
path: root/drivers/input/evdev.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-04-14 18:16:43 +0100
committerMark Brown <broonie@linaro.org>2014-04-14 18:16:43 +0100
commit1226ec098c08e408fcfa9c778480cfef30852183 (patch)
tree2d28f1cce689b76640a62de4cfe75ad0b099076f /drivers/input/evdev.c
parent8bb495e3f02401ee6f76d1b1d77f3ac9f079e376 (diff)
parent52b07c2707864bd8fa67093912dc6a4d2d602493 (diff)
Merge tag 'hugepages-v8-for-stable-20140305' of http://git.linaro.org/people/steve.capper/linux into lsk-v3.10-hugepages
Hugepages for arm64 with fixes, applied to 3.10.32 stable. Hugepages were already against 3.10-rc4 when they were merged into 3.11, so did not need to be rebased. I've included all the pertinent fixes I am aware of for hugepages too, I did need to rebase "Introduce PTE_WRITE" as there were some S2 definitions near the PTE_RDONLY bits. -- Steve
Diffstat (limited to 'drivers/input/evdev.c')
-rw-r--r--drivers/input/evdev.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index f0f8928b3c8..c122dd2adc2 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -18,6 +18,8 @@
#include <linux/poll.h>
#include <linux/sched.h>
#include <linux/slab.h>
+#include <linux/vmalloc.h>
+#include <linux/mm.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/input/mt.h>
@@ -289,7 +291,11 @@ static int evdev_release(struct inode *inode, struct file *file)
mutex_unlock(&evdev->mutex);
evdev_detach_client(evdev, client);
- kfree(client);
+
+ if (is_vmalloc_addr(client))
+ vfree(client);
+ else
+ kfree(client);
evdev_close_device(evdev);
@@ -309,12 +315,14 @@ static int evdev_open(struct inode *inode, struct file *file)
{
struct evdev *evdev = container_of(inode->i_cdev, struct evdev, cdev);
unsigned int bufsize = evdev_compute_buffer_size(evdev->handle.dev);
+ unsigned int size = sizeof(struct evdev_client) +
+ bufsize * sizeof(struct input_event);
struct evdev_client *client;
int error;
- client = kzalloc(sizeof(struct evdev_client) +
- bufsize * sizeof(struct input_event),
- GFP_KERNEL);
+ client = kzalloc(size, GFP_KERNEL | __GFP_NOWARN);
+ if (!client)
+ client = vzalloc(size);
if (!client)
return -ENOMEM;