diff options
-rw-r--r-- | drivers/net/wan/sdla.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c index 43ae6f440bfb..e155938c4f82 100644 --- a/drivers/net/wan/sdla.c +++ b/drivers/net/wan/sdla.c | |||
@@ -1211,14 +1211,9 @@ static int sdla_xfer(struct net_device *dev, struct sdla_mem __user *info, int r | |||
1211 | } | 1211 | } |
1212 | else | 1212 | else |
1213 | { | 1213 | { |
1214 | temp = kmalloc(mem.len, GFP_KERNEL); | 1214 | temp = memdup_user(mem.data, mem.len); |
1215 | if (!temp) | 1215 | if (IS_ERR(temp)) |
1216 | return(-ENOMEM); | 1216 | return PTR_ERR(temp); |
1217 | if(copy_from_user(temp, mem.data, mem.len)) | ||
1218 | { | ||
1219 | kfree(temp); | ||
1220 | return -EFAULT; | ||
1221 | } | ||
1222 | sdla_write(dev, mem.addr, temp, mem.len); | 1217 | sdla_write(dev, mem.addr, temp, mem.len); |
1223 | kfree(temp); | 1218 | kfree(temp); |
1224 | } | 1219 | } |