Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752101AbbHGIQ3 (ORCPT ); Fri, 7 Aug 2015 04:16:29 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:23212 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755349AbbHGIAa (ORCPT ); Fri, 7 Aug 2015 04:00:30 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-4d-55c4659bcd75 From: Andrzej Hajda To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH 06/31] arch/powerpc/pseries: use kmemdup rather than duplicating its implementation Date: Fri, 07 Aug 2015 09:59:12 +0200 Message-id: <1438934377-4922-7-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1438934377-4922-1-git-send-email-a.hajda@samsung.com> References: <1438934377-4922-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDLMWRmVeSWpSXmKPExsVy+t/xK7qzU4+EGtx+ymtxa905VouNM9az WnxoamW2uLxrDpvF7+//WC3WHrnLbrGl4RCbxZoji9kdODwWvWxg8eh508LqcX7GQkaPubv6 GD36tqxi9Pi8SS6ALYrLJiU1J7MstUjfLoEro3vKP6aCRs6KfaumMDYwPmHvYuTkkBAwkfh/ 4huULSZx4d56NhBbSGApo8SJjWFdjFxAdhOTRGvrU7AiNgFNib+bb7KBJEQEGhkl5s2cygSS YBY4yyhxcW5JFyMHh7BAqsTNV34gJouAqsSqjdkgFbwCThLTtk+G2iUncfLYZFYQm1PAWWJl 90xWiL1OEm/6LjBPYORdwMiwilE0tTS5oDgpPddQrzgxt7g0L10vOT93EyMkzL7sYFx8zOoQ owAHoxIPb8K/w6FCrIllxZW5hxglOJiVRHgf6gOFeFMSK6tSi/Lji0pzUosPMUpzsCiJ887d 9T5ESCA9sSQ1OzW1ILUIJsvEwSnVwBhw3vm6aV683ePG7w4nWqddyvXWWq2z5EHj9YQltdLv jue/vJFWNXFjitErdiGVshbPKdZ8SibfbrA/fZfwJyxVS88y6fcjvRsF9QVTuh5OnCaQe/Sb zMzMhdYyln7n8xq0LygpTHnT+nROzduYTY7afyu59l2pCFRS/zK9+L/y1sT4SWcO/VBiKc5I NNRiLipOBABk/8IcLwIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1366 Lines: 37 The patch was generated using fixed coccinelle semantic patch scripts/coccinelle/api/memdup.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320 Signed-off-by: Andrzej Hajda --- arch/powerpc/platforms/pseries/hotplug-memory.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index 0ced387..e9ff44c 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c @@ -92,13 +92,12 @@ static struct property *dlpar_clone_drconf_property(struct device_node *dn) return NULL; new_prop->name = kstrdup(prop->name, GFP_KERNEL); - new_prop->value = kmalloc(prop->length, GFP_KERNEL); + new_prop->value = kmemdup(prop->value, prop->length, GFP_KERNEL); if (!new_prop->name || !new_prop->value) { dlpar_free_drconf_property(new_prop); return NULL; } - memcpy(new_prop->value, prop->value, prop->length); new_prop->length = prop->length; /* Convert the property to cpu endian-ness */ -- 1.9.1 -- 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/