linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: remove unnecessary assignment in ext4_htree_store_dirent()
@ 2019-12-06  5:43 Chengguang Xu
  2020-01-13 18:52 ` Theodore Y. Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Chengguang Xu @ 2019-12-06  5:43 UTC (permalink / raw)
  To: tytso, adilger.kernel; +Cc: linux-ext4, Chengguang Xu

We have allocated memory using kzalloc() so don't have
to set 0 again in last byte.

Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
---
 fs/ext4/dir.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index 9fdd2b269d61..5923c9147ae7 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -458,7 +458,6 @@ int ext4_htree_store_dirent(struct file *dir_file, __u32 hash,
 	new_fn->name_len = ent_name->len;
 	new_fn->file_type = dirent->file_type;
 	memcpy(new_fn->name, ent_name->name, ent_name->len);
-	new_fn->name[ent_name->len] = 0;
 
 	while (*p) {
 		parent = *p;
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-13 18:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06  5:43 [PATCH] ext4: remove unnecessary assignment in ext4_htree_store_dirent() Chengguang Xu
2020-01-13 18:52 ` Theodore Y. Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).