Messages in this thread Patch in this message | | | Subject | [PATCH] dlm: Cocci spatch "memdup.spatch" | From | Thomas Meyer <> | Date | Sat, 01 Jun 2013 11:38:52 +0200 |
| |
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; } }
| |