Skip to contentSkip to conversation

user_namespace: Remove unnecessary ‘NULL’ values from map_write

PATCH In review Li zeming 2 participants 2 messages Jul 31, 2023 – Aug 1, 2023

lore
Share & tools
lore

Li zeming

author
#0 lore raw

PATCH 1/1 user_namespace: Remove unnecessary ‘NULL’ values from map_write

kbuf is assigned first, so it does not need to initialize the assignment.

---
 kernel/user_namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/user_namespace.c +1 -1
index 1d8e47bed3f1..6fabf388bb8a 100644
@@ -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 */
Signature · 1 line
2.18.2
Reviewed-by on v1 1/1
#1 lore raw

On 8/1/23 11:45, Li zeming wrote:

^^^^^^^^^^^^^^^

Please fix your system's date/time.

Quoted 4 lines

kbuf is assigned first, so it does not need to initialize the assignment.

Thanks.

Quoted 17 lines
---
 kernel/user_namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/user_namespace.c +1 -1
index 1d8e47bed3f1..6fabf388bb8a 100644
@@ -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 */
Signature · 1 line
~Randy