Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422672AbbHGIAp (ORCPT ); Fri, 7 Aug 2015 04:00:45 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:23238 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422653AbbHGIAm (ORCPT ); Fri, 7 Aug 2015 04:00:42 -0400 X-AuditID: cbfec7f5-f794b6d000001495-14-55c465a87b15 From: Andrzej Hajda To: Oleg Drokin , Andreas Dilger Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , linux-kernel@vger.kernel.org, HPDD-discuss@ml01.01.org, devel@driverdev.osuosl.org Subject: [PATCH 19/31] staging/lustre: use kmemdup rather than duplicating its implementation Date: Fri, 07 Aug 2015 09:59:25 +0200 Message-id: <1438934377-4922-20-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+NgFprBLMWRmVeSWpSXmKPExsVy+t/xK7orUo+EGhy6ZWhxa905VouGa69Y LTbOWM9qsefML3aL302LmS0u75rDZrH2yF12i8WfmhkdODzu7TvM4rF4z0smj+7Z/1g8+ras YvT4vEkugDWKyyYlNSezLLVI3y6BK6OvwbfgJlfFj2VaDYzNnF2MnBwSAiYS6/auY4SwxSQu 3FvP1sXIxSEksJRRYvXUT8wQThOTxLod91hAqtgENCX+br7JBmKLCIRIbG2+ygpSxCzwlFHi ePNbdpCEsEC8xLXla8HGsgioSsy8eQOsmVfAWWLmlh0sEOvkJE4em8wKYnMCxVd2zwSzhQSc JN70XWCewMi7gJFhFaNoamlyQXFSeq6RXnFibnFpXrpecn7uJkZIeH3dwbj0mNUhRgEORiUe 3oR/h0OFWBPLiitzDzFKcDArifA+1AcK8aYkVlalFuXHF5XmpBYfYpTmYFES5525632IkEB6 YklqdmpqQWoRTJaJg1OqgZFldbzdz+c/Ap+0926SCbUNY7/loX3i1MfgdVcs45s6z8f8NFSc Fjrnl3eI1u33CsmP84xCs+K6Tzxier68fO+rzuzMqZ7c2bN/7TjzhkteOyBki8r+3ENhMUL3 on3+f54iHDR/su+nmXXLfx3e/n+ekqC8utH3mFXrJ/dfMbdk4WA0fyCUaqPEUpyRaKjFXFSc CAAB5SeBKwIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1571 Lines: 48 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 --- drivers/staging/lustre/lustre/obdclass/acl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/acl.c b/drivers/staging/lustre/lustre/obdclass/acl.c index bc3fc47..933456c 100644 --- a/drivers/staging/lustre/lustre/obdclass/acl.c +++ b/drivers/staging/lustre/lustre/obdclass/acl.c @@ -104,11 +104,10 @@ static int lustre_posix_acl_xattr_reduce_space(posix_acl_xattr_header **header, if (unlikely(old_count <= new_count)) return old_size; - new = kzalloc(new_size, GFP_NOFS); + new = kmemdup(*header, new_size, GFP_NOFS); if (unlikely(new == NULL)) return -ENOMEM; - memcpy(new, *header, new_size); kfree(*header); *header = new; return new_size; @@ -125,11 +124,10 @@ static int lustre_ext_acl_xattr_reduce_space(ext_acl_xattr_header **header, if (unlikely(old_count <= ext_count)) return 0; - new = kzalloc(ext_size, GFP_NOFS); + new = kmemdup(*header, ext_size, GFP_NOFS); if (unlikely(new == NULL)) return -ENOMEM; - memcpy(new, *header, ext_size); kfree(*header); *header = new; return 0; -- 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/