scsi: message: fusion: Use kmemdup instead of memcpy and kmalloc
[linux-2.6-microblaze.git] / drivers / message / fusion / mptbase.c
index d8882b0..c2dd322 100644 (file)
@@ -6001,13 +6001,12 @@ mpt_findImVolumes(MPT_ADAPTER *ioc)
        if (mpt_config(ioc, &cfg) != 0)
                goto out;
 
-       mem = kmalloc(iocpage2sz, GFP_KERNEL);
+       mem = kmemdup(pIoc2, iocpage2sz, GFP_KERNEL);
        if (!mem) {
                rc = -ENOMEM;
                goto out;
        }
 
-       memcpy(mem, (u8 *)pIoc2, iocpage2sz);
        ioc->raid_data.pIocPg2 = (IOCPage2_t *) mem;
 
        mpt_read_ioc_pg_3(ioc);