Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1432066 > unrolled thread

Re: [PATCH] tipc: Use kmemdup instead of kmalloc and memcpy

Started byDavid Miller <davem@davemloft.net>
First post2016-06-27 16:10 +0200
Last post2016-06-27 16:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] tipc: Use kmemdup instead of kmalloc and memcpy David Miller <davem@davemloft.net> - 2016-06-27 16:10 +0200

#1432066 — Re: [PATCH] tipc: Use kmemdup instead of kmalloc and memcpy

FromDavid Miller <davem@davemloft.net>
Date2016-06-27 16:10 +0200
SubjectRe: [PATCH] tipc: Use kmemdup instead of kmalloc and memcpy
Message-ID<rOFoD-1gZ-45@gated-at.bofh.it>
From: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Date: Thu, 23 Jun 2016 10:19:37 +0530

> Replace calls to kmalloc followed by a memcpy with a direct call to
> kmemdup.
> 
> The Coccinelle semantic patch used to make this change is as follows:
> @@
> expression from,to,size,flag;
> statement S;
> @@
> 
> -  to = \(kmalloc\|kzalloc\)(size,flag);
> +  to = kmemdup(from,size,flag);
>    if (to==NULL || ...) S
> -  memcpy(to, from, size);
> 
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>

Applied.

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web