Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755700AbbHGIDh (ORCPT ); Fri, 7 Aug 2015 04:03:37 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:21635 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422696AbbHGIAu (ORCPT ); Fri, 7 Aug 2015 04:00:50 -0400 X-AuditID: cbfec7f5-f794b6d000001495-41-55c465b02825 From: Andrzej Hajda To: Jon Maloy , Ying Xue Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , linux-kernel@vger.kernel.org, "David S. Miller" , netdev@vger.kernel.org Subject: [PATCH 27/31] net/tipc: use kmemdup rather than duplicating its implementation Date: Fri, 07 Aug 2015 09:59:33 +0200 Message-id: <1438934377-4922-28-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+NgFprJLMWRmVeSWpSXmKPExsVy+t/xK7obUo+EGjzYL2txa905VouNM9az Wsw538JisX/WZWaLy7vmsFmsPXKX3eLYAjGLx9evMztweGxZeZPJ49fXq2wefVtWMXp83iTn sX7LVqYA1igum5TUnMyy1CJ9uwSujL03Z7EWLGSrWP5sIksDYw9rFyMnh4SAicTzs3PZIWwx iQv31rN1MXJxCAksZZRYtPEnI4TTxCTReHEeE0gVm4CmxN/NN9lAbBEBT4nz/U1gRcwC7xkl Tp09zQKSEBaIlDi/+TUjiM0ioCpxb1MTWJxXwFni9opJzBDr5CROHpsMdgYnUHxl90wwW0jA SeJN3wXmCYy8CxgZVjGKppYmFxQnpeca6RUn5haX5qXrJefnbmKEBNjXHYxLj1kdYhTgYFTi 4U34dzhUiDWxrLgy9xCjBAezkgjvQ32gEG9KYmVValF+fFFpTmrxIUZpDhYlcd6Zu96HCAmk J5akZqemFqQWwWSZODilGhhN92f8YNlS8GbVGd6bJ3qiLtcK3L57bWH/8xj23pfvzRquWH9Y 33i+WYil6Lv1gbpgrUcbVpuWBEwMCvHef3Tx7neC/J9jth6+uWQe/yNGlq3ar8Q87fvWXNqm E1zb9ruvomjhW4+Zhirlyv83qsy0+vqaiX+C8/OIuUp+cZXF6r3spY3m66yUWIozEg21mIuK EwGqtlE8LAIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1014 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 --- net/tipc/server.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/tipc/server.c b/net/tipc/server.c index 922e04a..c187cad 100644 --- a/net/tipc/server.c +++ b/net/tipc/server.c @@ -411,13 +411,12 @@ static struct outqueue_entry *tipc_alloc_entry(void *data, int len) if (!entry) return NULL; - buf = kmalloc(len, GFP_ATOMIC); + buf = kmemdup(data, len, GFP_ATOMIC); if (!buf) { kfree(entry); return NULL; } - memcpy(buf, data, len); entry->iov.iov_base = buf; entry->iov.iov_len = len; -- 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/