user_namespace: Remove unnecessary ‘NULL’ values from kbuf

Message ID 20240115062519.31298-1-zeming@nfschina.com
State New
Headers
Series user_namespace: Remove unnecessary ‘NULL’ values from kbuf |

Commit Message

Li zeming Jan. 15, 2024, 6:25 a.m. UTC
  kbuf is assigned first, so it does not need to initialize the
assignment.

Signed-off-by: Li zeming <zeming@nfschina.com>
---
 kernel/user_namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index 1d8e47bed3f11..6fabf388bb8a8 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -928,7 +928,7 @@  static ssize_t map_write(struct file *file, const char __user *buf,
 	struct uid_gid_map new_map;
 	unsigned idx;
 	struct uid_gid_extent extent;
-	char *kbuf = NULL, *pos, *next_line;
+	char *kbuf, *pos, *next_line;
 	ssize_t ret;
 
 	/* Only allow < page size writes at the beginning of the file */