lkml.org 
[lkml]   [2013]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] dlm: Cocci spatch "memdup.spatch"
From
Date

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

diff -u -p a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -1213,10 +1213,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: 2013-06-01 12:21    [W:0.033 / U:2.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site