VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Amitoj Kaur Chawla <amitoj1606@gmail.com> 2016-06-23 10:22:01 +0530 committer: David Teigland <teigland@redhat.com> 2016-06-23 11:55:58 -0500 commit: 5c93f56f770e69c4cf2dbaebecd6bcca205949f9 parent: 505ee5283c3d23220dfbf7630bfc4efdc391e743
Commit Summary:
dlm: Use kmemdup instead of kmalloc and memcpy
Diffstat:
1 file changed, 1 insertion, 2 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 1ab012a27d9f..963016c8f3d1 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -1279,10 +1279,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;
 	}
 }