Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751346AbbHGIHO (ORCPT ); Fri, 7 Aug 2015 04:07:14 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:25491 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422674AbbHGIAr (ORCPT ); Fri, 7 Aug 2015 04:00:47 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-b5-55c465ad3a41 From: Andrzej Hajda To: Bob Copeland Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , linux-kernel@vger.kernel.org, linux-karma-devel@lists.sourceforge.net Subject: [PATCH 24/31] fs/omfs: use kmemdup rather than duplicating its implementation Date: Fri, 07 Aug 2015 09:59:30 +0200 Message-id: <1438934377-4922-25-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+NgFupiluLIzCtJLcpLzFFi42I5/e/4Fd21qUdCDV6uVrG4te4cq8XGGetZ LVpub2e3uLxrDpvF2iN32S0md7xndmDz2Lurg8lj94LPTB59W1YxenzeJBfAEsVlk5Kak1mW WqRvl8CVMb9Lq6CTveLj4ReMDYz3WbsYOTkkBEwkGnrPM0PYYhIX7q1n62Lk4hASWMoo8fH6 dlYIp4lJ4v6KB2wgVWwCmhJ/N98Es0UEVCVeTPrMBFLELHCdUWL5oQawscICERLtFy+wgNgs QEW7Vr4Es3kFnCUaNoA0gKyTkzh5bDJYPSdQfGX3TDBbSMBJ4k3fBeYJjLwLGBlWMYqmliYX FCel5xrqFSfmFpfmpesl5+duYoSE0JcdjIuPWR1iFOBgVOLhTfh3OFSINbGsuDL3EKMEB7OS CO9DfaAQb0piZVVqUX58UWlOavEhRmkOFiVx3rm73ocICaQnlqRmp6YWpBbBZJk4OKUaGA0V H2s73FjBy9FfuXxK3PKgbwnbd/efmjkp7vI9H5vl5T5+Zyb+crH26Zqtpyjua6B7cVGdO9/3 1iezrTaaLI/7/vCvbvKa9ITdzadTw5yvu+XmJR+tLVvx+0xWWldS51Gfn7J3WLRWKra78x62 2LfSYiaTmhnj00PFSmdkWM0XpN77mJKrosRSnJFoqMVcVJwIALcYDVUdAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1119 Lines: 36 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 --- fs/omfs/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index 3d935c8..02af1a3 100644 --- a/fs/omfs/inode.c +++ b/fs/omfs/inode.c @@ -333,12 +333,11 @@ static int omfs_get_imap(struct super_block *sb) bh = sb_bread(sb, block++); if (!bh) goto nomem_free; - *ptr = kmalloc(sb->s_blocksize, GFP_KERNEL); + *ptr = kmemdup(bh->b_data, sb->s_blocksize, GFP_KERNEL); if (!*ptr) { brelse(bh); goto nomem_free; } - memcpy(*ptr, bh->b_data, sb->s_blocksize); if (count < sb->s_blocksize) memset((void *)*ptr + count, 0xff, sb->s_blocksize - count); -- 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/