]> git.baikalelectronics.ru Git - kernel.git/commit
ext2: Use kmemdup rather than duplicating its implementation
authorFuqian Huang <huangfq.daxian@gmail.com>
Wed, 3 Jul 2019 13:17:27 +0000 (21:17 +0800)
committerJan Kara <jack@suse.cz>
Wed, 3 Jul 2019 14:24:25 +0000 (16:24 +0200)
commite6c25a8aeb36740be5ca1efa17c41f6a72d07c3e
tree7a486f87d06779c52b6ebb2ea95383d84fbcda68
parent8537728b36d3c9059f7ad6e77824d45dc8977fde
ext2: Use kmemdup rather than duplicating its implementation

kmemdup is introduced to duplicate a region of memory in a neat way.
Rather than kmalloc/kzalloc + memset, which the programmer needs to
write the size twice (sometimes lead to mistakes), kmemdup improves
readability, leads to smaller code and also reduce the chances of mistakes.
Suggestion to use kmemdup rather than using kmalloc/kzalloc + memset.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Link: https://lore.kernel.org/r/20190703131727.25735-1-huangfq.daxian@gmail.com
Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext2/xattr.c