Message ID | 1536892438-129520-1-git-send-email-yuehaibing@huawei.com (mailing list archive) |
---|---|
State | Deferred |
Headers | show |
Series | [-next] scsi: mptfusion: Use kmemdup rather than duplicating its implementation in mpt_remove_dead_ioc_func | expand |
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index dc1e43a..a32d3d0 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -6001,13 +6001,12 @@ static int mpt_remove_dead_ioc_func(void *arg) if (mpt_config(ioc, &cfg) != 0) goto out; - mem = kmalloc(iocpage2sz, GFP_KERNEL); + mem = kmemdup((u8 *)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);
Use kmemdup rather than duplicating its implementation Signed-off-by: YueHaibing <yuehaibing@huawei.com> --- drivers/message/fusion/mptbase.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)