|
@@ -635,15 +635,14 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
|
|
|
}
|
|
|
} else {
|
|
|
struct user_sgmap* usg;
|
|
|
- usg = kmalloc(actual_fibsize - sizeof(struct aac_srb)
|
|
|
- + sizeof(struct sgmap), GFP_KERNEL);
|
|
|
+ usg = kmemdup(upsg,
|
|
|
+ actual_fibsize - sizeof(struct aac_srb)
|
|
|
+ + sizeof(struct sgmap), GFP_KERNEL);
|
|
|
if (!usg) {
|
|
|
dprintk((KERN_DEBUG"aacraid: Allocation error in Raw SRB command\n"));
|
|
|
rcode = -ENOMEM;
|
|
|
goto cleanup;
|
|
|
}
|
|
|
- memcpy (usg, upsg, actual_fibsize - sizeof(struct aac_srb)
|
|
|
- + sizeof(struct sgmap));
|
|
|
actual_fibsize = actual_fibsize64;
|
|
|
|
|
|
for (i = 0; i < usg->count; i++) {
|