diff options
Diffstat (limited to 'drivers/staging/rtl8192e/rtl8192e/rtl_core.c')
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 6ba02fc..bd8c9a2 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -2593,14 +2593,9 @@ static int rtl8192_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) goto out; } - ipw = kmalloc(p->length, GFP_KERNEL); - if (ipw == NULL) { - ret = -ENOMEM; - goto out; - } - if (copy_from_user(ipw, p->pointer, p->length)) { - kfree(ipw); - ret = -EFAULT; + ipw = memdup_user(p->pointer, p->length); + if (IS_ERR(ipw)) { + ret = PTR_ERR(ipw); goto out; } |