From df222fd7ad86388e72ec7b6a939612fc3ec2ff80 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Wed, 26 May 2010 14:43:56 -0700 Subject: [PATCH] --- yaml --- r: 198801 b: refs/heads/master c: f67231f80126f4e08c79c7b2056989c5c89ad4c6 h: refs/heads/master i: 198799: f6cc217f17be0025b4e23252e01c92874f376b99 v: v3 --- [refs] | 2 +- trunk/drivers/char/applicom.c | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 31b1f5f895a7..c6f92bdbcd73 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 87575437d8173c7da48a4dee25399807c7bec9cb +refs/heads/master: f67231f80126f4e08c79c7b2056989c5c89ad4c6 diff --git a/trunk/drivers/char/applicom.c b/trunk/drivers/char/applicom.c index 63313a33ba5f..f4ae0e0fb631 100644 --- a/trunk/drivers/char/applicom.c +++ b/trunk/drivers/char/applicom.c @@ -703,14 +703,9 @@ static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg) /* In general, the device is only openable by root anyway, so we're not particularly concerned that bogus ioctls can flood the console. */ - adgl = kmalloc(sizeof(struct st_ram_io), GFP_KERNEL); - if (!adgl) - return -ENOMEM; - - if (copy_from_user(adgl, argp, sizeof(struct st_ram_io))) { - kfree(adgl); - return -EFAULT; - } + adgl = memdup_user(argp, sizeof(struct st_ram_io)); + if (IS_ERR(adgl)) + return PTR_ERR(adgl); lock_kernel(); IndexCard = adgl->num_card-1;