lkml.org 
[lkml]   [2015]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 21/31] fs/dlm: use kmemdup rather than duplicating its implementation
From
Date
Ping.

Regards
Andrzej

On 08/07/2015 09:59 AM, Andrzej Hajda wrote:
> 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 <a.hajda@samsung.com>
> ---
> fs/dlm/lowcomms.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
> index 754fd6c..b31b32a 100644
> --- a/fs/dlm/lowcomms.c
> +++ b/fs/dlm/lowcomms.c
> @@ -1317,10 +1317,9 @@ static void init_local(void)
> if (dlm_our_addr(&sas, i))
> break;
>
> - addr = kmalloc(sizeof(*addr), GFP_NOFS);
> + addr = kmemdup(&sas, sizeof(*addr), GFP_NOFS);
> if (!addr)
> break;
> - memcpy(addr, &sas, sizeof(*addr));
> dlm_local_addr[dlm_local_count++] = addr;
> }
> }



\
 
 \ /
  Last update: 2015-09-16 12:21    [W:0.486 / U:0.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site