mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 06:31:49 +00:00
scsi: message: fusion: Use kmemdup instead of memcpy and kmalloc
Replace kmalloc + memcpy with kmemdup. This was reported by coccinelle. Signed-off-by: Bharath Vedartham <linux.bhar@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
de19212c28
commit
b3b2a9f60f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user