mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
mtip32xx: don't open-code memdup_user()
[folded a fix by Dan Carpenter] Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
793b796ebf
commit
8ed6010d50
1 changed files with 8 additions and 15 deletions
|
|
@ -2029,13 +2029,10 @@ static int exec_drive_taskfile(struct driver_data *dd,
|
|||
}
|
||||
|
||||
if (taskout) {
|
||||
outbuf = kzalloc(taskout, GFP_KERNEL);
|
||||
if (outbuf == NULL) {
|
||||
err = -ENOMEM;
|
||||
goto abort;
|
||||
}
|
||||
if (copy_from_user(outbuf, buf + outtotal, taskout)) {
|
||||
err = -EFAULT;
|
||||
outbuf = memdup_user(buf + outtotal, taskout);
|
||||
if (IS_ERR(outbuf)) {
|
||||
err = PTR_ERR(outbuf);
|
||||
outbuf = NULL;
|
||||
goto abort;
|
||||
}
|
||||
outbuf_dma = pci_map_single(dd->pdev,
|
||||
|
|
@ -2050,14 +2047,10 @@ static int exec_drive_taskfile(struct driver_data *dd,
|
|||
}
|
||||
|
||||
if (taskin) {
|
||||
inbuf = kzalloc(taskin, GFP_KERNEL);
|
||||
if (inbuf == NULL) {
|
||||
err = -ENOMEM;
|
||||
goto abort;
|
||||
}
|
||||
|
||||
if (copy_from_user(inbuf, buf + intotal, taskin)) {
|
||||
err = -EFAULT;
|
||||
inbuf = memdup_user(buf + intotal, taskin);
|
||||
if (IS_ERR(inbuf)) {
|
||||
err = PTR_ERR(inbuf);
|
||||
inbuf = NULL;
|
||||
goto abort;
|
||||
}
|
||||
inbuf_dma = pci_map_single(dd->pdev,
|
||||
|
|
|
|||
Loading…
Reference in a new issue