Skip to contentSkip to conversation

nsproxy: Remove unnecessary ‘0’ values from ret

PATCH New Li kunyu 1 participant 1 message Nov 1, 2023

lore
Share & tools
lore

Li kunyu

author
#0 lore raw

PATCH 1/1 nsproxy: Remove unnecessary ‘0’ values from ret

The ret variable can be defined without assigning a value, as it is assigned before use.

---
 kernel/nsproxy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/nsproxy.c +1 -1
index 15781acaac1ce..b7e398d954b09 100644
@@ -374,12 +374,12 @@ static inline int validate_ns(struct nsset *nsset, struct ns_common *ns)
  */
 static int validate_nsset(struct nsset *nsset, struct pid *pid)
 {
-	int ret = 0;
 	unsigned flags = nsset->flags;
 	struct user_namespace *user_ns = NULL;
 	struct pid_namespace *pid_ns = NULL;
 	struct nsproxy *nsp;
 	struct task_struct *tsk;
+	int ret;
 
 	/* Take a "snapshot" of the target task's namespaces. */
 	rcu_read_lock();
Signature · 1 line
2.18.2