Skip to contentSkip to conversation

proc/proc_sysctl: Remove unnecessary 'NULL' values from Pointer

PATCH In review Li zeming 2 participants 3 messages Sep 5, 2022 – Sep 9, 2022

Subsystems (3)
lore
Share & tools
lore

Li zeming

author
#0 lore raw

PATCH 1/1 proc/proc_sysctl: Remove unnecessary 'NULL' values from Pointer

Pointer variables allocate memory first, and then judge. There is no need to initialize the assignment.

---
 fs/proc/proc_sysctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/proc/proc_sysctl.c +1 -1
index 021e83fe831f..50ba9e4fb284 100644
@@ -1246,7 +1246,7 @@ static bool get_links(struct ctl_dir *dir,
 static int insert_links(struct ctl_table_header *head)
 {
 	struct ctl_table_set *root_set = &sysctl_table_root.default_set;
-	struct ctl_dir *core_parent = NULL;
+	struct ctl_dir *core_parent;
 	struct ctl_table_header *links;
 	int err;
 
Signature · 1 line
2.18.2
#1 lore raw
Quoted 4 lines · Li zeming

Pointer variables allocate memory first, and then judge. There is no need to initialize the assignment.

you sent the same patch before, and with a different subject... Anyway the first one was queued up already, in the future please use a bit better subject.

Luis