Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755300Ab3CSNTW (ORCPT ); Tue, 19 Mar 2013 09:19:22 -0400 Received: from mail-ee0-f53.google.com ([74.125.83.53]:51205 "EHLO mail-ee0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751874Ab3CSNTU (ORCPT ); Tue, 19 Mar 2013 09:19:20 -0400 From: Alexandru Gheorghiu To: Nagalakshmi Nandigama Cc: Sreekanth Reddy , support@lsi.com, linux-kernel@vger.kernel.org, Alexandru Gheorghiu Subject: [PATCH] drivers: message: fusion: Use kmemdup function Date: Tue, 19 Mar 2013 06:13:35 +0200 Message-Id: <1363666415-31465-1-git-send-email-gheorghiuandru@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1060 Lines: 35 Used kmemdup function instead of kmalloc and memcpy. Patch found using coccinelle. Signed-off-by: Alexandru Gheorghiu --- drivers/message/fusion/mptbase.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index fb69baa..d2bae18 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -6004,13 +6004,12 @@ mpt_findImVolumes(MPT_ADAPTER *ioc) 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); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/